Chromium Code Reviews| Index: net/proxy/proxy_service.cc |
| diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc |
| index 9989b8221cdc09944ce3e14622d3d088851b6f7e..6e6d6e37e5b72545237e4cf5c604060c44817ab1 100644 |
| --- a/net/proxy/proxy_service.cc |
| +++ b/net/proxy/proxy_service.cc |
| @@ -1318,47 +1318,37 @@ void ProxyService::ForceReloadProxyConfig() { |
| ApplyProxyConfigIfAvailable(); |
| } |
| +void ProxyService::StartTearDown() { |
| + config_service_->StartTearDown(); |
| +} |
| + |
| // static |
| ProxyConfigService* ProxyService::CreateSystemProxyConfigService( |
| - base::SingleThreadTaskRunner* io_thread_task_runner, |
| + base::SingleThreadTaskRunner* glib_thread_task_runner, |
| MessageLoop* file_loop) { |
| #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( |
| + MessageLoopForIO::current()->message_loop_proxy()); |
| #elif defined(OS_CHROMEOS) |
| LOG(ERROR) << "ProxyConfigService for ChromeOS should be created in " |
| << "profile_io_data.cc::CreateProxyConfigService and this should " |
| << "be used only for examples."; |
| return new UnsetProxyConfigService; |
| #elif defined(OS_LINUX) |
| - ProxyConfigServiceLinux* linux_config_service = |
| - new ProxyConfigServiceLinux(); |
| - |
| - // Assume we got called on the thread that runs the default glib |
| - // main loop, so the current thread is where we should be running |
| - // gconf calls from. |
| - scoped_refptr<base::SingleThreadTaskRunner> glib_thread_task_runner = |
| - base::ThreadTaskRunnerHandle::Get(); |
| - |
| // The file loop should be a MessageLoopForIO on Linux. |
| DCHECK_EQ(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. |
| - linux_config_service->SetupAndFetchInitialConfig( |
| - glib_thread_task_runner, io_thread_task_runner, |
| + return new ProxyConfigServiceLinux( |
| + glib_thread_task_runner, |
| + MessageLoopForIO::current()->message_loop_proxy(), |
| static_cast<MessageLoopForIO*>(file_loop)); |
| - |
| - return linux_config_service; |
| #elif defined(OS_ANDROID) |
| return new ProxyConfigServiceAndroid( |
| - io_thread_task_runner, |
| - MessageLoopForUI::current()->message_loop_proxy()); |
| + glib_thread_task_runner, |
|
Philippe
2012/10/18 09:22:38
If you swap the two message loops here for consist
|
| + MessageLoopForIO::current()->message_loop_proxy()); |
| #else |
| LOG(WARNING) << "Failed to choose a system proxy settings fetcher " |
| "for this platform."; |