Index: chromecast/shell/browser/url_request_context_factory.cc |
diff --git a/chromecast/shell/browser/url_request_context_factory.cc b/chromecast/shell/browser/url_request_context_factory.cc |
index 03b5d9ddf659a49a21e31c82aab33c658efdda16..08e5188a52d6c1a6dfab7499f17aadf7246f75f8 100644 |
--- a/chromecast/shell/browser/url_request_context_factory.cc |
+++ b/chromecast/shell/browser/url_request_context_factory.cc |
@@ -63,8 +63,10 @@ class URLRequestContextFactory::URLRequestContextGetter |
request_context_.reset(factory_->CreateMediaRequestContext()); |
} else { |
request_context_.reset(factory_->CreateSystemRequestContext()); |
+#if defined(USE_NSS) |
// Set request context used by NSS for Crl requests. |
net::SetURLRequestContextForNSSHttpIO(request_context_.get()); |
+#endif // defined(USE_NSS) |
} |
} |
return request_context_.get(); |
@@ -144,6 +146,14 @@ void URLRequestContextFactory::InitializeOnUIThread() { |
// because it registers itself to pref notification observer which is not |
// thread safe. |
http_user_agent_settings_.reset(new CastHttpUserAgentSettings()); |
+ |
+ // Proxy config service should be initialized in UI thread, since |
+ // ProxyConfigServiceDelegate on Android expects UI thread. |
+ proxy_config_service_.reset(net::ProxyService::CreateSystemProxyConfigService( |
+ content::BrowserThread::GetMessageLoopProxyForThread( |
+ content::BrowserThread::IO).get(), |
+ content::BrowserThread::UnsafeGetMessageLoopForThread( |
+ content::BrowserThread::FILE))); |
} |
net::URLRequestContextGetter* URLRequestContextFactory::CreateMainGetter( |
@@ -201,13 +211,7 @@ void URLRequestContextFactory::InitializeSystemContextDependencies() { |
http_server_properties_.reset(new net::HttpServerPropertiesImpl); |
proxy_service_.reset(net::ProxyService::CreateUsingSystemProxyResolver( |
- net::ProxyService::CreateSystemProxyConfigService( |
- content::BrowserThread::GetMessageLoopProxyForThread( |
- content::BrowserThread::IO).get(), |
- content::BrowserThread::UnsafeGetMessageLoopForThread( |
- content::BrowserThread::FILE)), |
- 0, |
- NULL)); |
+ proxy_config_service_.release(), 0, NULL)); |
system_dependencies_initialized_ = true; |
} |