Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3151)

Unified Diff: base/message_loop/message_loop.cc

Issue 2418933004: Reduce usage of FOR_EACH_OBSERVER macro in base (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/memory/memory_pressure_listener.cc ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.cc
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc
index 823b8bb3d3f8be2e094d232c51992dc68b73422c..1581f6cfb4b494b543a4574c2ca786f18f631188 100644
--- a/base/message_loop/message_loop.cc
+++ b/base/message_loop/message_loop.cc
@@ -124,8 +124,8 @@ MessageLoop::~MessageLoop() {
DCHECK(!did_work);
// Let interested parties have one last shot at accessing this.
- FOR_EACH_OBSERVER(DestructionObserver, destruction_observers_,
- WillDestroyCurrentMessageLoop());
+ for (auto& observer : destruction_observers_)
+ observer.WillDestroyCurrentMessageLoop();
thread_task_runner_handle_.reset();
@@ -408,11 +408,11 @@ void MessageLoop::RunTask(PendingTask* pending_task) {
TRACE_TASK_EXECUTION("MessageLoop::RunTask", *pending_task);
- FOR_EACH_OBSERVER(TaskObserver, task_observers_,
- WillProcessTask(*pending_task));
+ for (auto& observer : task_observers_)
+ observer.WillProcessTask(*pending_task);
task_annotator_.RunTask("MessageLoop::PostTask", pending_task);
- FOR_EACH_OBSERVER(TaskObserver, task_observers_,
- DidProcessTask(*pending_task));
+ for (auto& observer : task_observers_)
+ observer.DidProcessTask(*pending_task);
nestable_tasks_allowed_ = true;
}
@@ -485,8 +485,8 @@ void MessageLoop::ScheduleWork() {
}
void MessageLoop::NotifyBeginNestedLoop() {
- FOR_EACH_OBSERVER(NestingObserver, nesting_observers_,
- OnBeginNestedMessageLoop());
+ for (auto& observer : nesting_observers_)
+ observer.OnBeginNestedMessageLoop();
}
bool MessageLoop::DoWork() {
« no previous file with comments | « base/memory/memory_pressure_listener.cc ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698