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

Unified Diff: ios/web/web_thread_impl.cc

Issue 1167533009: Revert of ios: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « ios/web/web_thread_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ios/web/web_thread_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698