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

Unified Diff: net/proxy/proxy_service.cc

Issue 540593002: Use scoped_refptr<SingleThreadTaskRunner> when initializing ProxyConfigService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « net/proxy/proxy_service.h ('k') | net/tools/net_watcher/net_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 0de696f68b551261057e1fdbb2cccc6e6640f8e0..4c59024746da2662e643bf8f4568d0c9a124d645 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.";
« no previous file with comments | « net/proxy/proxy_service.h ('k') | net/tools/net_watcher/net_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698