| Index: base/observer_list_threadsafe.h
|
| diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h
|
| index 70b4f11ffa60ca252f5a5d7b69ed047851ea41ca..f9702ba66cfbee2b1398d067a8e9ca9709b319b3 100644
|
| --- a/base/observer_list_threadsafe.h
|
| +++ b/base/observer_list_threadsafe.h
|
| @@ -14,9 +14,10 @@
|
| #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"
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| @@ -208,11 +209,9 @@ class ObserverListThreadSafe
|
|
|
| struct ObserverListContext {
|
| explicit ObserverListContext(NotificationType type)
|
| - : loop(base::MessageLoopProxy::current()),
|
| - list(type) {
|
| - }
|
| + : task_runner(base::ThreadTaskRunnerHandle::Get()), list(type) {}
|
|
|
| - scoped_refptr<base::MessageLoopProxy> loop;
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner;
|
| ObserverList<ObserverType> list;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ObserverListContext);
|
| @@ -228,10 +227,13 @@ class ObserverListThreadSafe
|
| typename ObserversListMap::iterator it;
|
| for (it = observer_lists_.begin(); it != observer_lists_.end(); ++it) {
|
| ObserverListContext* context = (*it).second;
|
| - context->loop->PostTask(
|
| + context->task_runner->PostTask(
|
| FROM_HERE,
|
| - base::Bind(&ObserverListThreadSafe<ObserverType>::
|
| - template NotifyWrapper<Method, Params>, this, context, method));
|
| + base::Bind(&ObserverListThreadSafe<
|
| + ObserverType>::template NotifyWrapper<Method, Params>,
|
| + this,
|
| + context,
|
| + method));
|
| }
|
| }
|
|
|
| @@ -249,7 +251,7 @@ class ObserverListThreadSafe
|
| observer_lists_.find(base::PlatformThread::CurrentId());
|
|
|
| // The ObserverList could have been removed already. In fact, it could
|
| - // have been removed and then re-added! If the master list's loop
|
| + // have been removed and then re-added! If the master list's task runner
|
| // does not match this one, then we do not need to finish this
|
| // notification.
|
| if (it == observer_lists_.end() || it->second != context)
|
|
|