Commit c2740989 authored by skyostil's avatar skyostil Committed by Commit bot

ios: Remove use of MessageLoopProxy and deprecated MessageLoop APIs

BUG=465354

Committed: https://crrev.com/9c8e5d7259661cda32b698ee88254491e6984900
Cr-Commit-Position: refs/heads/master@{#333080}

Review URL: https://codereview.chromium.org/1160403005

Cr-Commit-Position: refs/heads/master@{#333105}
parent 9a312138
...@@ -60,7 +60,7 @@ class RetryableURLFetcherTest : public PlatformTest { ...@@ -60,7 +60,7 @@ class RetryableURLFetcherTest : public PlatformTest {
TEST_F(RetryableURLFetcherTest, TestResponse200) { TEST_F(RetryableURLFetcherTest, TestResponse200) {
scoped_refptr<net::URLRequestContextGetter> request_context_getter = scoped_refptr<net::URLRequestContextGetter> request_context_getter =
new net::TestURLRequestContextGetter(message_loop_.message_loop_proxy()); new net::TestURLRequestContextGetter(message_loop_.task_runner());
base::scoped_nsobject<RetryableURLFetcher> retryableFetcher( base::scoped_nsobject<RetryableURLFetcher> retryableFetcher(
[[RetryableURLFetcher alloc] [[RetryableURLFetcher alloc]
initWithRequestContextGetter:request_context_getter.get() initWithRequestContextGetter:request_context_getter.get()
...@@ -81,7 +81,7 @@ TEST_F(RetryableURLFetcherTest, TestResponse200) { ...@@ -81,7 +81,7 @@ TEST_F(RetryableURLFetcherTest, TestResponse200) {
TEST_F(RetryableURLFetcherTest, TestResponse404) { TEST_F(RetryableURLFetcherTest, TestResponse404) {
scoped_refptr<net::URLRequestContextGetter> request_context_getter = scoped_refptr<net::URLRequestContextGetter> request_context_getter =
new net::TestURLRequestContextGetter(message_loop_.message_loop_proxy()); new net::TestURLRequestContextGetter(message_loop_.task_runner());
base::scoped_nsobject<RetryableURLFetcher> retryableFetcher( base::scoped_nsobject<RetryableURLFetcher> retryableFetcher(
[[RetryableURLFetcher alloc] [[RetryableURLFetcher alloc]
initWithRequestContextGetter:request_context_getter.get() initWithRequestContextGetter:request_context_getter.get()
......
...@@ -212,8 +212,8 @@ void ConvertAndSaveGreyImage( ...@@ -212,8 +212,8 @@ void ConvertAndSaveGreyImage(
} }
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
web::WebThread::GetMessageLoopProxyForThread( web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE_USER_BLOCKING)
web::WebThread::FILE_USER_BLOCKING).get(), .get(),
FROM_HERE, base::BindBlock(^base::scoped_nsobject<UIImage>() { FROM_HERE, base::BindBlock(^base::scoped_nsobject<UIImage>() {
// Retrieve the image on a high priority thread. // Retrieve the image on a high priority thread.
return base::scoped_nsobject<UIImage>([ReadImageFromDisk( return base::scoped_nsobject<UIImage>([ReadImageFromDisk(
...@@ -401,10 +401,9 @@ void ConvertAndSaveGreyImage( ...@@ -401,10 +401,9 @@ void ConvertAndSaveGreyImage(
// already in the cache, use it. // already in the cache, use it.
UIImage* img = [imageDictionary_ objectForKey:sessionID]; UIImage* img = [imageDictionary_ objectForKey:sessionID];
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
web::WebThread::GetMessageLoopProxyForThread( web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE_USER_BLOCKING)
web::WebThread::FILE_USER_BLOCKING).get(), .get(),
FROM_HERE, FROM_HERE, base::BindBlock(^base::scoped_nsobject<UIImage>() {
base::BindBlock(^base::scoped_nsobject<UIImage>() {
base::scoped_nsobject<UIImage> result([img retain]); base::scoped_nsobject<UIImage> result([img retain]);
// If the image is not in the cache, load it from disk. // If the image is not in the cache, load it from disk.
if (!result) if (!result)
...@@ -465,10 +464,9 @@ void ConvertAndSaveGreyImage( ...@@ -465,10 +464,9 @@ void ConvertAndSaveGreyImage(
} }
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
web::WebThread::GetMessageLoopProxyForThread( web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE_USER_BLOCKING)
web::WebThread::FILE_USER_BLOCKING).get(), .get(),
FROM_HERE, FROM_HERE, base::BindBlock(^base::scoped_nsobject<UIImage>() {
base::BindBlock(^base::scoped_nsobject<UIImage>() {
// Retrieve the image on a high priority thread. // Retrieve the image on a high priority thread.
// Loading the file into NSData is more reliable. // Loading the file into NSData is more reliable.
// -imageWithContentsOfFile would ocassionally claim the image was not a // -imageWithContentsOfFile would ocassionally claim the image was not a
......
...@@ -55,21 +55,21 @@ class CrNetURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -55,21 +55,21 @@ class CrNetURLRequestContextGetter : public net::URLRequestContextGetter {
public: public:
CrNetURLRequestContextGetter( CrNetURLRequestContextGetter(
net::URLRequestContext* context, net::URLRequestContext* context,
const scoped_refptr<base::MessageLoopProxy>& loop) const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
: context_(context), loop_(loop) {} : context_(context), task_runner_(task_runner) {}
net::URLRequestContext* GetURLRequestContext() override { return context_; } net::URLRequestContext* GetURLRequestContext() override { return context_; }
scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner()
const override { const override {
return loop_; return task_runner_;
} }
private: private:
// Must be called on the IO thread. // Must be called on the IO thread.
~CrNetURLRequestContextGetter() override {} ~CrNetURLRequestContextGetter() override {}
net::URLRequestContext* context_; net::URLRequestContext* context_;
scoped_refptr<base::MessageLoopProxy> loop_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
DISALLOW_COPY_AND_ASSIGN(CrNetURLRequestContextGetter); DISALLOW_COPY_AND_ASSIGN(CrNetURLRequestContextGetter);
}; };
...@@ -260,7 +260,7 @@ void CrNetEnvironment::Install() { ...@@ -260,7 +260,7 @@ void CrNetEnvironment::Install() {
// delegates will receive callbacks. // delegates will receive callbacks.
network_change_notifier_.reset(net::NetworkChangeNotifier::Create()); network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService(
network_io_thread_->message_loop_proxy(), nullptr)); network_io_thread_->task_runner(), nullptr));
PostToNetworkThread(FROM_HERE, PostToNetworkThread(FROM_HERE,
base::Bind(&CrNetEnvironment::InitializeOnNetworkThread, base::Bind(&CrNetEnvironment::InitializeOnNetworkThread,
...@@ -268,7 +268,7 @@ void CrNetEnvironment::Install() { ...@@ -268,7 +268,7 @@ void CrNetEnvironment::Install() {
net::SetURLRequestContextForNSSHttpIO(main_context_.get()); net::SetURLRequestContextForNSSHttpIO(main_context_.get());
main_context_getter_ = new CrNetURLRequestContextGetter( main_context_getter_ = new CrNetURLRequestContextGetter(
main_context_.get(), network_io_thread_->message_loop_proxy()); main_context_.get(), network_io_thread_->task_runner());
SetRequestFilterBlock(nil); SetRequestFilterBlock(nil);
net_log_started_ = false; net_log_started_ = false;
} }
...@@ -310,7 +310,7 @@ void CrNetEnvironment::InitializeOnNetworkThread() { ...@@ -310,7 +310,7 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
net::RequestTracker::AddGlobalNetworkClientFactory( net::RequestTracker::AddGlobalNetworkClientFactory(
[[[WebPNetworkClientFactory alloc] [[[WebPNetworkClientFactory alloc]
initWithTaskRunner:file_user_blocking_thread_ initWithTaskRunner:file_user_blocking_thread_
->message_loop_proxy()] autorelease]); ->task_runner()] autorelease]);
#if 0 #if 0
// TODO(huey): Re-enable this once SDCH supports SSL and dictionaries from // TODO(huey): Re-enable this once SDCH supports SSL and dictionaries from
...@@ -373,12 +373,10 @@ void CrNetEnvironment::InitializeOnNetworkThread() { ...@@ -373,12 +373,10 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
base::mac::NSStringToFilePath([dirs objectAtIndex:0]); base::mac::NSStringToFilePath([dirs objectAtIndex:0]);
cache_path = cache_path.Append(FILE_PATH_LITERAL("crnet")); cache_path = cache_path.Append(FILE_PATH_LITERAL("crnet"));
net::HttpCache::DefaultBackend* main_backend = net::HttpCache::DefaultBackend* main_backend =
new net::HttpCache::DefaultBackend( new net::HttpCache::DefaultBackend(net::DISK_CACHE,
net::DISK_CACHE, net::CACHE_BACKEND_DEFAULT, cache_path,
net::CACHE_BACKEND_DEFAULT, 0, // Default cache size.
cache_path, network_cache_thread_->task_runner());
0, // Default cache size.
network_cache_thread_->message_loop_proxy());
net::HttpNetworkSession::Params params; net::HttpNetworkSession::Params params;
params.host_resolver = main_context_->host_resolver(); params.host_resolver = main_context_->host_resolver();
...@@ -421,7 +419,7 @@ void CrNetEnvironment::InitializeOnNetworkThread() { ...@@ -421,7 +419,7 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
new net::URLRequestJobFactoryImpl; new net::URLRequestJobFactoryImpl;
job_factory->SetProtocolHandler("data", new net::DataProtocolHandler); job_factory->SetProtocolHandler("data", new net::DataProtocolHandler);
job_factory->SetProtocolHandler( job_factory->SetProtocolHandler(
"file", new net::FileProtocolHandler(file_thread_->message_loop_proxy())); "file", new net::FileProtocolHandler(file_thread_->task_runner()));
main_context_->set_job_factory(job_factory); main_context_->set_job_factory(job_factory);
} }
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h" #include "base/mac/scoped_nsobject.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/observer_list.h" #include "base/observer_list.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/task_runner_util.h" #include "base/task_runner_util.h"
#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "ios/net/cookies/cookie_creation_time_manager.h" #include "ios/net/cookies/cookie_creation_time_manager.h"
#include "ios/net/cookies/cookie_store_ios_client.h" #include "ios/net/cookies/cookie_store_ios_client.h"
...@@ -798,7 +798,7 @@ void CookieStoreIOS::OnSystemCookiesChanged() { ...@@ -798,7 +798,7 @@ void CookieStoreIOS::OnSystemCookiesChanged() {
flush_closure_.Reset(base::Bind(&CookieStoreIOS::Flush, flush_closure_.Reset(base::Bind(&CookieStoreIOS::Flush,
base::Unretained(this), base::Closure())); base::Unretained(this), base::Closure()));
base::MessageLoopProxy::current()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, flush_closure_.callback(), flush_delay_); FROM_HERE, flush_closure_.callback(), flush_delay_);
} }
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/task_runner_util.h" #include "base/task_runner_util.h"
namespace base { namespace base {
...@@ -84,8 +83,8 @@ class WebThread { ...@@ -84,8 +83,8 @@ class WebThread {
// NOTE: do not add new threads here that are only used by a small number of // 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 // files. Instead you should just use a Thread class and pass its
// MessageLoopProxy around. Named threads there are only for threads that // SingleThreadTaskRunner around. Named threads there are only for threads
// are used in many places. // that are used in many places.
// This identifier does not represent a thread. Instead it counts the // This identifier does not represent a thread. Instead it counts the
// number of well-known threads. Insert new well-known threads before this // number of well-known threads. Insert new well-known threads before this
...@@ -124,18 +123,17 @@ class WebThread { ...@@ -124,18 +123,17 @@ class WebThread {
const tracked_objects::Location& from_here, const tracked_objects::Location& from_here,
const base::Callback<ReturnType(void)>& task, const base::Callback<ReturnType(void)>& task,
const base::Callback<void(ReplyArgType)>& reply) { const base::Callback<void(ReplyArgType)>& reply) {
scoped_refptr<base::MessageLoopProxy> message_loop_proxy = scoped_refptr<base::SingleThreadTaskRunner> task_runner =
GetMessageLoopProxyForThread(identifier); GetTaskRunnerForThread(identifier);
return base::PostTaskAndReplyWithResult(message_loop_proxy.get(), from_here, return base::PostTaskAndReplyWithResult(task_runner.get(), from_here, task,
task, reply); reply);
} }
template <class T> template <class T>
static bool DeleteSoon(ID identifier, static bool DeleteSoon(ID identifier,
const tracked_objects::Location& from_here, const tracked_objects::Location& from_here,
const T* object) { const T* object) {
return GetMessageLoopProxyForThread(identifier) return GetTaskRunnerForThread(identifier)->DeleteSoon(from_here, object);
->DeleteSoon(from_here, object);
} }
// Simplified wrappers for posting to the blocking thread pool. Use this // Simplified wrappers for posting to the blocking thread pool. Use this
...@@ -202,9 +200,9 @@ class WebThread { ...@@ -202,9 +200,9 @@ class WebThread {
// sets identifier to its ID. // sets identifier to its ID.
static bool GetCurrentThreadIdentifier(ID* identifier) WARN_UNUSED_RESULT; static bool GetCurrentThreadIdentifier(ID* identifier) WARN_UNUSED_RESULT;
// Callers can hold on to a refcounted MessageLoopProxy beyond the lifetime // Callers can hold on to a refcounted SingleThreadTaskRunner beyond the
// of the thread. // lifetime of the thread.
static scoped_refptr<base::MessageLoopProxy> GetMessageLoopProxyForThread( static scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunnerForThread(
ID identifier); ID identifier);
// Returns an appropriate error message for when // Returns an appropriate error message for when
......
...@@ -20,9 +20,9 @@ ShellBrowserState::ShellBrowserState() : BrowserState() { ...@@ -20,9 +20,9 @@ ShellBrowserState::ShellBrowserState() : BrowserState() {
request_context_getter_ = new ShellURLRequestContextGetter( request_context_getter_ = new ShellURLRequestContextGetter(
GetStatePath(), GetStatePath(),
web::WebThread::GetMessageLoopProxyForThread(web::WebThread::IO), web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
web::WebThread::GetMessageLoopProxyForThread(web::WebThread::FILE), web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE),
web::WebThread::GetMessageLoopProxyForThread(web::WebThread::CACHE)); web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE));
} }
ShellBrowserState::~ShellBrowserState() { ShellBrowserState::~ShellBrowserState() {
......
...@@ -40,7 +40,7 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter( ...@@ -40,7 +40,7 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
const base::FilePath& base_path, const base::FilePath& base_path,
const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner,
const scoped_refptr<base::MessageLoopProxy>& cache_task_runner) const scoped_refptr<base::SingleThreadTaskRunner>& cache_task_runner)
: base_path_(base_path), : base_path_(base_path),
file_task_runner_(file_task_runner), file_task_runner_(file_task_runner),
network_task_runner_(network_task_runner), network_task_runner_(network_task_runner),
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
...@@ -32,7 +31,7 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -32,7 +31,7 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter {
const base::FilePath& base_path, const base::FilePath& base_path,
const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner, const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner,
const scoped_refptr<base::MessageLoopProxy>& cache_task_runner); const scoped_refptr<base::SingleThreadTaskRunner>& cache_task_runner);
// net::URLRequestContextGetter implementation. // net::URLRequestContextGetter implementation.
net::URLRequestContext* GetURLRequestContext() override; net::URLRequestContext* GetURLRequestContext() override;
...@@ -46,7 +45,7 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter { ...@@ -46,7 +45,7 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter {
base::FilePath base_path_; base::FilePath base_path_;
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
scoped_refptr<base::MessageLoopProxy> cache_task_runner_; scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner_;
scoped_ptr<net::ProxyConfigService> proxy_config_service_; scoped_ptr<net::ProxyConfigService> proxy_config_service_;
scoped_ptr<net::NetworkDelegate> network_delegate_; scoped_ptr<net::NetworkDelegate> network_delegate_;
scoped_ptr<net::URLRequestContextStorage> storage_; scoped_ptr<net::URLRequestContextStorage> storage_;
......
...@@ -164,7 +164,7 @@ bool WebThread::GetCurrentThreadIdentifier(ID* identifier) { ...@@ -164,7 +164,7 @@ bool WebThread::GetCurrentThreadIdentifier(ID* identifier) {
} }
// static // static
scoped_refptr<base::MessageLoopProxy> WebThread::GetMessageLoopProxyForThread( scoped_refptr<base::SingleThreadTaskRunner> WebThread::GetTaskRunnerForThread(
ID identifier) { ID identifier) {
return content::BrowserThread::GetMessageLoopProxyForThread( return content::BrowserThread::GetMessageLoopProxyForThread(
BrowserThreadIDFromWebThreadID(identifier)); BrowserThreadIDFromWebThreadID(identifier));
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_proxy.h" #include "base/single_thread_task_runner.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "ios/web/public/web_thread_delegate.h" #include "ios/web/public/web_thread_delegate.h"
...@@ -32,14 +32,13 @@ const char* g_web_thread_names[WebThread::ID_COUNT] = { ...@@ -32,14 +32,13 @@ const char* g_web_thread_names[WebThread::ID_COUNT] = {
"Web_IOThread", // IO "Web_IOThread", // IO
}; };
// An implementation of MessageLoopProxy to be used in conjunction // An implementation of SingleThreadTaskRunner to be used in conjunction
// with WebThread. // with WebThread.
class WebThreadMessageLoopProxy : public base::MessageLoopProxy { class WebThreadTaskRunner : public base::SingleThreadTaskRunner {
public: public:
explicit WebThreadMessageLoopProxy(WebThread::ID identifier) explicit WebThreadTaskRunner(WebThread::ID identifier) : id_(identifier) {}
: id_(identifier) {}
// MessageLoopProxy implementation. // SingleThreadTaskRunner implementation.
bool PostDelayedTask(const tracked_objects::Location& from_here, bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task, const base::Closure& task,
base::TimeDelta delay) override { base::TimeDelta delay) override {
...@@ -57,26 +56,26 @@ class WebThreadMessageLoopProxy : public base::MessageLoopProxy { ...@@ -57,26 +56,26 @@ class WebThreadMessageLoopProxy : public base::MessageLoopProxy {
} }
protected: protected:
~WebThreadMessageLoopProxy() override {} ~WebThreadTaskRunner() override {}
private: private:
WebThread::ID id_; WebThread::ID id_;
DISALLOW_COPY_AND_ASSIGN(WebThreadMessageLoopProxy); DISALLOW_COPY_AND_ASSIGN(WebThreadTaskRunner);
}; };
// A separate helper is used just for the proxies, in order to avoid needing // A separate helper is used just for the task runners, in order to avoid
// to initialize the globals to create a proxy. // needing to initialize the globals to create a task runner.
struct WebThreadProxies { struct WebThreadTaskRunners {
WebThreadProxies() { WebThreadTaskRunners() {
for (int i = 0; i < WebThread::ID_COUNT; ++i) { for (int i = 0; i < WebThread::ID_COUNT; ++i) {
proxies[i] = new WebThreadMessageLoopProxy(static_cast<WebThread::ID>(i)); task_runners[i] = new WebThreadTaskRunner(static_cast<WebThread::ID>(i));
} }
} }
scoped_refptr<base::MessageLoopProxy> proxies[WebThread::ID_COUNT]; scoped_refptr<base::SingleThreadTaskRunner> task_runners[WebThread::ID_COUNT];
}; };
base::LazyInstance<WebThreadProxies>::Leaky g_proxies = base::LazyInstance<WebThreadTaskRunners>::Leaky g_task_runners =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
struct WebThreadGlobals { struct WebThreadGlobals {
...@@ -451,7 +450,7 @@ bool WebThread::PostTaskAndReply(ID identifier, ...@@ -451,7 +450,7 @@ bool WebThread::PostTaskAndReply(ID identifier,
const tracked_objects::Location& from_here, const tracked_objects::Location& from_here,
const base::Closure& task, const base::Closure& task,
const base::Closure& reply) { const base::Closure& reply) {
return GetMessageLoopProxyForThread(identifier) return GetTaskRunnerForThread(identifier)
->PostTaskAndReply(from_here, task, reply); ->PostTaskAndReply(from_here, task, reply);
} }
...@@ -479,9 +478,9 @@ bool WebThread::GetCurrentThreadIdentifier(ID* identifier) { ...@@ -479,9 +478,9 @@ bool WebThread::GetCurrentThreadIdentifier(ID* identifier) {
} }
// static // static
scoped_refptr<base::MessageLoopProxy> WebThread::GetMessageLoopProxyForThread( scoped_refptr<base::SingleThreadTaskRunner> WebThread::GetTaskRunnerForThread(
ID identifier) { ID identifier) {
return g_proxies.Get().proxies[identifier]; return g_task_runners.Get().task_runners[identifier];
} }
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment