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

Unified Diff: base/observer_list_threadsafe.h

Issue 1113953002: Revert of base: Remove use of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/weak_ptr_unittest.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/observer_list_threadsafe.h
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
index e0ce0daa90f74e5db7ddef6bb250f70f35989c61..5205a5a9d1f47f4f696592195269c290cf874e1f 100644
--- a/base/observer_list_threadsafe.h
+++ b/base/observer_list_threadsafe.h
@@ -14,10 +14,9 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_loop_proxy.h"
#include "base/observer_list.h"
-#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
-#include "base/thread_task_runner_handle.h"
#include "base/threading/platform_thread.h"
///////////////////////////////////////////////////////////////////////////////
@@ -178,7 +177,7 @@
base::AutoLock lock(list_lock_);
for (const auto& entry : observer_lists_) {
ObserverListContext* context = entry.second;
- context->task_runner->PostTask(
+ context->loop->PostTask(
from_here,
base::Bind(
&ObserverListThreadSafe<ObserverType>::template NotifyWrapper<
@@ -193,9 +192,11 @@
struct ObserverListContext {
explicit ObserverListContext(NotificationType type)
- : task_runner(base::ThreadTaskRunnerHandle::Get()), list(type) {}
-
- scoped_refptr<base::SingleThreadTaskRunner> task_runner;
+ : loop(base::MessageLoopProxy::current()),
+ list(type) {
+ }
+
+ scoped_refptr<base::MessageLoopProxy> loop;
ObserverList<ObserverType> list;
private:
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | base/observer_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698