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

Unified Diff: chromecast/shell/browser/url_request_context_factory.cc

Issue 490603002: Chromecast: initial checkin of Android-based cast shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698