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

Unified Diff: content/shell/shell_url_request_context_getter.cc

Issue 10912132: Move ProxyConfigService construction onto the IO thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extra blank line Created 8 years, 2 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: content/shell/shell_url_request_context_getter.cc
diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc
index f612fa56a61f9e4d043da2a31e1daf151306c072..f1cb95fe8f1a11f970b8390100ba0b18ce595bd2 100644
--- a/content/shell/shell_url_request_context_getter.cc
+++ b/content/shell/shell_url_request_context_getter.cc
@@ -39,20 +39,16 @@ ShellURLRequestContextGetter::ShellURLRequestContextGetter(
base_path_(base_path),
io_loop_(io_loop),
file_loop_(file_loop) {
- // Must first be created on the UI thread.
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- // We must create the proxy config service on the UI loop on Linux because it
- // must synchronously run on the glib message loop. This will be passed to
- // the URLRequestContextStorage on the IO thread in GetURLRequestContext().
- proxy_config_service_.reset(
- net::ProxyService::CreateSystemProxyConfigService(
- io_loop_->message_loop_proxy(), file_loop_));
}
ShellURLRequestContextGetter::~ShellURLRequestContextGetter() {
}
+void ShellURLRequestContextGetter::StartTearDown() {
+ if (url_request_context_.get())
+ url_request_context_->proxy_service()->StartTearDown();
+}
+
net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -79,9 +75,11 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
// TODO(jam): use v8 if possible, look at chrome code.
storage_->set_proxy_service(
net::ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service_.release(),
- 0,
- NULL));
+ net::ProxyService::CreateSystemProxyConfigService(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
+ file_loop_),
+ 0,
+ NULL));
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
storage_->set_http_auth_handler_factory(
net::HttpAuthHandlerFactory::CreateDefault(

Powered by Google App Engine
This is Rietveld 408576698