[cleanup] clang-format base.
Produced with:
find base -name \"*.cc\" -o -name \"*.h\" -o -name \"*.mm\" | xargs clang-format -i
base/third_party was then manually reset.
[email protected]
NO_IFTTT=Reformat only
Bug: none
Change-Id: Ie567eb767d41315fd60e8a17c6aee8a90ff6a3ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6117971
Commit-Queue: Peter Kasting <[email protected]>
Owners-Override: Peter Boström <[email protected]>
Auto-Submit: Peter Kasting <[email protected]>
Reviewed-by: Peter Boström <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1400624}
diff --git a/base/message_loop/message_pump_android.cc b/base/message_loop/message_pump_android.cc
index 3c40c2b..f1aed62 100644
--- a/base/message_loop/message_pump_android.cc
+++ b/base/message_loop/message_pump_android.cc
@@ -56,8 +56,9 @@
NO_INSTRUMENT_STACK_ALIGN int NonDelayedLooperCallback(int fd,
int events,
void* data) {
- if (events & ALOOPER_EVENT_HANGUP)
+ if (events & ALOOPER_EVENT_HANGUP) {
return 0;
+ }
DCHECK(events & ALOOPER_EVENT_INPUT);
MessagePumpAndroid* pump = reinterpret_cast<MessagePumpAndroid*>(data);
@@ -68,8 +69,9 @@
NO_INSTRUMENT_STACK_ALIGN int DelayedLooperCallback(int fd,
int events,
void* data) {
- if (events & ALOOPER_EVENT_HANGUP)
+ if (events & ALOOPER_EVENT_HANGUP) {
return 0;
+ }
DCHECK(events & ALOOPER_EVENT_INPUT);
MessagePumpAndroid* pump = reinterpret_cast<MessagePumpAndroid*>(data);
@@ -360,13 +362,15 @@
// callbacks. Check here, and if there's already an exception, just skip this
// iteration without clearing the fd. If the exception ends up being non-fatal
// then we'll just get called again on the next polling iteration.
- if (base::android::HasException(env_))
+ if (base::android::HasException(env_)) {
return;
+ }
// ALooper_pollOnce may call this after Quit() if OnNonDelayedLooperCallback()
// resulted in Quit() in the same round.
- if (ShouldQuit())
+ if (ShouldQuit()) {
return;
+ }
// Clear the fd.
uint64_t value;
@@ -390,8 +394,9 @@
Delegate::NextWorkInfo next_work_info = delegate_->DoWork();
- if (ShouldQuit())
+ if (ShouldQuit()) {
return;
+ }
if (next_work_info.is_immediate()) {
ScheduleWork();
@@ -399,8 +404,9 @@
}
delegate_->DoIdleWork();
- if (!next_work_info.delayed_run_time.is_max())
+ if (!next_work_info.delayed_run_time.is_max()) {
ScheduleDelayedWork(next_work_info);
+ }
}
void MessagePumpAndroid::OnNonDelayedLooperCallback() {
@@ -410,13 +416,15 @@
// callbacks. Check here, and if there's already an exception, just skip this
// iteration without clearing the fd. If the exception ends up being non-fatal
// then we'll just get called again on the next polling iteration.
- if (base::android::HasException(env_))
+ if (base::android::HasException(env_)) {
return;
+ }
// ALooper_pollOnce may call this after Quit() if OnDelayedLooperCallback()
// resulted in Quit() in the same round.
- if (ShouldQuit())
+ if (ShouldQuit()) {
return;
+ }
// We're about to process all the work requested by ScheduleWork().
// MessagePump users are expected to do their best not to invoke
@@ -441,8 +449,9 @@
// Runs all application tasks scheduled to run.
Delegate::NextWorkInfo next_work_info;
do {
- if (ShouldQuit())
+ if (ShouldQuit()) {
return;
+ }
next_work_info = delegate_->DoWork();
@@ -471,8 +480,9 @@
// Do not resignal |non_delayed_fd_| if we're quitting (this pump doesn't
// allow nesting so needing to resume in an outer loop is not an issue
// either).
- if (ShouldQuit())
+ if (ShouldQuit()) {
return;
+ }
// Under the fast to sleep feature, `do_idle_work` is ignored, and the pump
// will always "sleep" after finishing all its work items.
@@ -539,8 +549,9 @@
}
void MessagePumpAndroid::Quit() {
- if (quit_)
+ if (quit_) {
return;
+ }
quit_ = true;
@@ -597,8 +608,9 @@
void MessagePumpAndroid::ScheduleDelayedWork(
const Delegate::NextWorkInfo& next_work_info) {
- if (ShouldQuit())
+ if (ShouldQuit()) {
return;
+ }
if (delayed_scheduled_time_ &&
*delayed_scheduled_time_ == next_work_info.delayed_run_time) {