Index: chrome/browser/io_thread.cc |
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
index b8b3c9000033954a6e31e17ec8dee9cba1930b1b..76ac6fbd3e13697992b4ef7bf77899e91014db9c 100644 |
--- a/chrome/browser/io_thread.cc |
+++ b/chrome/browser/io_thread.cc |
@@ -379,8 +379,7 @@ IOThread::~IOThread() { |
// be multiply constructed. |
BrowserThread::SetDelegate(BrowserThread::IO, NULL); |
- if (pref_proxy_config_tracker_.get()) |
- pref_proxy_config_tracker_->DetachFromPrefService(); |
+ pref_proxy_config_tracker_->DetachFromPrefService(); |
DCHECK(!globals_); |
} |
@@ -536,6 +535,8 @@ void IOThread::Init() { |
globals_->proxy_script_fetcher_context.reset( |
ConstructProxyScriptFetcherContext(globals_, net_log_)); |
+ system_proxy_config_service_.reset( |
+ ProxyServiceFactory::CreateProxyConfigService(true)); |
sdch_manager_ = new net::SdchManager(); |
#if defined(OS_MACOSX) && !defined(OS_IOS) |
@@ -674,14 +675,8 @@ void IOThread::InitSystemRequestContext() { |
// If we're in unit_tests, IOThread may not be run. |
if (!BrowserThread::IsMessageLoopValid(BrowserThread::IO)) |
return; |
- bool wait_for_first_update = (pref_proxy_config_tracker_.get() != NULL); |
- ChromeProxyConfigService* proxy_config_service = |
- ProxyServiceFactory::CreateProxyConfigService(wait_for_first_update); |
- system_proxy_config_service_.reset(proxy_config_service); |
- if (pref_proxy_config_tracker_.get()) { |
- pref_proxy_config_tracker_->SetChromeProxyConfigService( |
- proxy_config_service); |
- } |
+ pref_proxy_config_tracker_->SetChromeProxyConfigService( |
+ system_proxy_config_service_.get()); |
system_url_request_context_getter_ = |
new SystemURLRequestContextGetter(this); |
// Safe to post an unretained this pointer, since IOThread is |
@@ -737,3 +732,8 @@ void IOThread::InitSystemRequestContextOnIOThread() { |
sdch_manager_->set_sdch_fetcher( |
new SdchDictionaryFetcher(system_url_request_context_getter_.get())); |
} |
+ |
+void IOThread::StartTearDown() { |
+ globals_->system_proxy_service->StartTearDown(); |
+} |
+ |