diff options
author | sergeyu <sergeyu@chromium.org> | 2014-09-04 18:39:40 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-05 01:43:54 +0000 |
commit | 3f923064c11c69f13a7aba56dce6620a33166c94 (patch) | |
tree | 2addeba01ccd32adadbae6556cf3f8566a7c8149 /net/proxy/proxy_service.cc | |
parent | 84eae5e4c626a3b61b13b22fd13f859ec410583a (diff) | |
download | chromium_src-3f923064c11c69f13a7aba56dce6620a33166c94.zip chromium_src-3f923064c11c69f13a7aba56dce6620a33166c94.tar.gz chromium_src-3f923064c11c69f13a7aba56dce6620a33166c94.tar.bz2 |
Use scoped_refptr<SingleThreadTaskRunner> when initializing ProxyConfigService
Previously MessageLoop was used to pass reference to the FILE thread
to ProxyConfigServiceLinux. Changeed it to use SingleThreadTaskRunner.
Also for other thread the task runners were passed as raw pointers.
Changed it to use scoped_refptr<> instead.
TBR=jochen@chromium.org
Review URL: https://codereview.chromium.org/540593002
Cr-Commit-Position: refs/heads/master@{#293395}
Diffstat (limited to 'net/proxy/proxy_service.cc')
-rw-r--r-- | net/proxy/proxy_service.cc | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index 0de696f..4c59024 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -1397,14 +1397,14 @@ void ProxyService::ForceReloadProxyConfig() { // static ProxyConfigService* ProxyService::CreateSystemProxyConfigService( - base::SingleThreadTaskRunner* io_thread_task_runner, - base::MessageLoop* file_loop) { + const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, + const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner) { #if defined(OS_WIN) return new ProxyConfigServiceWin(); #elif defined(OS_IOS) return new ProxyConfigServiceIOS(); #elif defined(OS_MACOSX) - return new ProxyConfigServiceMac(io_thread_task_runner); + return new ProxyConfigServiceMac(io_task_runner); #elif defined(OS_CHROMEOS) LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in " << "profile_io_data.cc::CreateProxyConfigService and this should " @@ -1420,23 +1420,17 @@ ProxyConfigService* ProxyService::CreateSystemProxyConfigService( scoped_refptr<base::SingleThreadTaskRunner> glib_thread_task_runner = base::ThreadTaskRunnerHandle::Get(); - // The file loop should be a MessageLoopForIO on Linux. - DCHECK_EQ(base::MessageLoop::TYPE_IO, file_loop->type()); - - // Synchronously fetch the current proxy config (since we are - // running on glib_default_loop). Additionally register for - // notifications (delivered in either |glib_default_loop| or - // |file_loop|) to keep us updated when the proxy config changes. + // Synchronously fetch the current proxy config (since we are running on + // glib_default_loop). Additionally register for notifications (delivered in + // either |glib_default_loop| or |file_task_runner|) to keep us updated when + // the proxy config changes. linux_config_service->SetupAndFetchInitialConfig( - glib_thread_task_runner.get(), - io_thread_task_runner, - static_cast<base::MessageLoopForIO*>(file_loop)); + glib_thread_task_runner, io_task_runner, file_task_runner); return linux_config_service; #elif defined(OS_ANDROID) return new ProxyConfigServiceAndroid( - io_thread_task_runner, - base::MessageLoop::current()->message_loop_proxy()); + io_task_runner, base::MessageLoop::current()->message_loop_proxy()); #else LOG(WARNING) << "Failed to choose a system proxy settings fetcher " "for this platform."; |