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

Unified Diff: chrome/service/net/service_url_request_context.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: chrome/service/net/service_url_request_context.cc
diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc
index a7ab6f2d2fe628f82012404c2a57be9007e99ad6..85b92ab44de030c68acd7df354be5e375f9d79a6 100644
--- a/chrome/service/net/service_url_request_context.cc
+++ b/chrome/service/net/service_url_request_context.cc
@@ -12,6 +12,7 @@
#include "base/message_loop_proxy.h"
#include "base/stringprintf.h"
#include "base/sys_info.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/service/service_process.h"
#include "net/base/cert_verifier.h"
@@ -157,26 +158,31 @@ ServiceURLRequestContext::~ServiceURLRequestContext() {
}
ServiceURLRequestContextGetter::ServiceURLRequestContextGetter()
- : network_task_runner_(
+ : main_task_runner_(base::ThreadTaskRunnerHandle::Get()),
+ network_task_runner_(
g_service_process->io_thread()->message_loop_proxy()) {
// Build the default user agent.
user_agent_ = MakeUserAgentForServiceProcess();
+}
- // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a
- // MessageLoopProxy* instead of MessageLoop*.
- DCHECK(g_service_process);
- proxy_config_service_.reset(
- net::ProxyService::CreateSystemProxyConfigService(
- g_service_process->io_thread()->message_loop_proxy(),
- g_service_process->file_thread()->message_loop()));
+void ServiceURLRequestContextGetter::StartTearDown() {
+ if (url_request_context_.get())
+ url_request_context_->proxy_service()->StartTearDown();
}
net::URLRequestContext*
ServiceURLRequestContextGetter::GetURLRequestContext() {
- if (!url_request_context_.get())
+ if (!url_request_context_.get()) {
+ // TODO(sanjeevr): Change CreateSystemProxyConfigService to accept a
+ // MessageLoopProxy* instead of MessageLoop*.
+ DCHECK(g_service_process);
url_request_context_.reset(
- new ServiceURLRequestContext(user_agent_,
- proxy_config_service_.release()));
+ new ServiceURLRequestContext(
+ user_agent_,
+ net::ProxyService::CreateSystemProxyConfigService(
+ main_task_runner_,
+ g_service_process->file_thread()->message_loop())));
+ }
return url_request_context_.get();
}

Powered by Google App Engine
This is Rietveld 408576698