Index: ios/web/web_thread_impl.cc |
diff --git a/ios/web/web_thread_impl.cc b/ios/web/web_thread_impl.cc |
index a4cacddcea848af75502f0ecf28883889a606a3a..e329bb03a8cc3a8b3dfc79e1fa7f9d471011807a 100644 |
--- a/ios/web/web_thread_impl.cc |
+++ b/ios/web/web_thread_impl.cc |
@@ -11,7 +11,7 @@ |
#include "base/compiler_specific.h" |
#include "base/lazy_instance.h" |
#include "base/message_loop/message_loop.h" |
-#include "base/single_thread_task_runner.h" |
+#include "base/message_loop/message_loop_proxy.h" |
#include "base/threading/sequenced_worker_pool.h" |
#include "base/threading/thread_restrictions.h" |
#include "ios/web/public/web_thread_delegate.h" |
@@ -32,13 +32,14 @@ |
"Web_IOThread", // IO |
}; |
-// An implementation of SingleThreadTaskRunner to be used in conjunction |
+// An implementation of MessageLoopProxy to be used in conjunction |
// with WebThread. |
-class WebThreadTaskRunner : public base::SingleThreadTaskRunner { |
+class WebThreadMessageLoopProxy : public base::MessageLoopProxy { |
public: |
- explicit WebThreadTaskRunner(WebThread::ID identifier) : id_(identifier) {} |
- |
- // SingleThreadTaskRunner implementation. |
+ explicit WebThreadMessageLoopProxy(WebThread::ID identifier) |
+ : id_(identifier) {} |
+ |
+ // MessageLoopProxy implementation. |
bool PostDelayedTask(const tracked_objects::Location& from_here, |
const base::Closure& task, |
base::TimeDelta delay) override { |
@@ -56,26 +57,26 @@ |
} |
protected: |
- ~WebThreadTaskRunner() override {} |
+ ~WebThreadMessageLoopProxy() override {} |
private: |
WebThread::ID id_; |
- DISALLOW_COPY_AND_ASSIGN(WebThreadTaskRunner); |
+ DISALLOW_COPY_AND_ASSIGN(WebThreadMessageLoopProxy); |
}; |
-// A separate helper is used just for the task runners, in order to avoid |
-// needing to initialize the globals to create a task runner. |
-struct WebThreadTaskRunners { |
- WebThreadTaskRunners() { |
+// A separate helper is used just for the proxies, in order to avoid needing |
+// to initialize the globals to create a proxy. |
+struct WebThreadProxies { |
+ WebThreadProxies() { |
for (int i = 0; i < WebThread::ID_COUNT; ++i) { |
- task_runners[i] = new WebThreadTaskRunner(static_cast<WebThread::ID>(i)); |
+ proxies[i] = new WebThreadMessageLoopProxy(static_cast<WebThread::ID>(i)); |
} |
} |
- scoped_refptr<base::SingleThreadTaskRunner> task_runners[WebThread::ID_COUNT]; |
+ scoped_refptr<base::MessageLoopProxy> proxies[WebThread::ID_COUNT]; |
}; |
-base::LazyInstance<WebThreadTaskRunners>::Leaky g_task_runners = |
+base::LazyInstance<WebThreadProxies>::Leaky g_proxies = |
LAZY_INSTANCE_INITIALIZER; |
struct WebThreadGlobals { |
@@ -450,7 +451,7 @@ |
const tracked_objects::Location& from_here, |
const base::Closure& task, |
const base::Closure& reply) { |
- return GetTaskRunnerForThread(identifier) |
+ return GetMessageLoopProxyForThread(identifier) |
->PostTaskAndReply(from_here, task, reply); |
} |
@@ -478,9 +479,9 @@ |
} |
// static |
-scoped_refptr<base::SingleThreadTaskRunner> WebThread::GetTaskRunnerForThread( |
+scoped_refptr<base::MessageLoopProxy> WebThread::GetMessageLoopProxyForThread( |
ID identifier) { |
- return g_task_runners.Get().task_runners[identifier]; |
+ return g_proxies.Get().proxies[identifier]; |
} |
// static |