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

Unified Diff: ios/web/public/web_thread.h

Issue 1160403005: ios: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error. 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/net/cookies/cookie_store_ios.mm ('k') | ios/web/shell/shell_browser_state.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/web_thread.h
diff --git a/ios/web/public/web_thread.h b/ios/web/public/web_thread.h
index 1f44d6311e4205231fe6694645fd6f3f7780a695..99f41c35014009a9373d597765ce7bc2a1d97fe0 100644
--- a/ios/web/public/web_thread.h
+++ b/ios/web/public/web_thread.h
@@ -11,7 +11,6 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/task_runner_util.h"
namespace base {
@@ -84,8 +83,8 @@ class WebThread {
// NOTE: do not add new threads here that are only used by a small number of
// files. Instead you should just use a Thread class and pass its
- // MessageLoopProxy around. Named threads there are only for threads that
- // are used in many places.
+ // SingleThreadTaskRunner around. Named threads there are only for threads
+ // that are used in many places.
// This identifier does not represent a thread. Instead it counts the
// number of well-known threads. Insert new well-known threads before this
@@ -124,18 +123,17 @@ class WebThread {
const tracked_objects::Location& from_here,
const base::Callback<ReturnType(void)>& task,
const base::Callback<void(ReplyArgType)>& reply) {
- scoped_refptr<base::MessageLoopProxy> message_loop_proxy =
- GetMessageLoopProxyForThread(identifier);
- return base::PostTaskAndReplyWithResult(message_loop_proxy.get(), from_here,
- task, reply);
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner =
+ GetTaskRunnerForThread(identifier);
+ return base::PostTaskAndReplyWithResult(task_runner.get(), from_here, task,
+ reply);
}
template <class T>
static bool DeleteSoon(ID identifier,
const tracked_objects::Location& from_here,
const T* object) {
- return GetMessageLoopProxyForThread(identifier)
- ->DeleteSoon(from_here, object);
+ return GetTaskRunnerForThread(identifier)->DeleteSoon(from_here, object);
}
// Simplified wrappers for posting to the blocking thread pool. Use this
@@ -202,9 +200,9 @@ class WebThread {
// sets identifier to its ID.
static bool GetCurrentThreadIdentifier(ID* identifier) WARN_UNUSED_RESULT;
- // Callers can hold on to a refcounted MessageLoopProxy beyond the lifetime
- // of the thread.
- static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxyForThread(
+ // Callers can hold on to a refcounted SingleThreadTaskRunner beyond the
+ // lifetime of the thread.
+ static scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunnerForThread(
ID identifier);
// Returns an appropriate error message for when
« no previous file with comments | « ios/net/cookies/cookie_store_ios.mm ('k') | ios/web/shell/shell_browser_state.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698