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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 10912132: Move ProxyConfigService construction onto the IO thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust comments 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: net/url_request/url_request_context_builder.cc
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index 3228bfbdf61ec66ec61c4a5b324aabadd7232a94..83e443fbc846992be65f9f8c25d97163b1845ab4 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -145,7 +145,7 @@ class BasicURLRequestContext : public URLRequestContext {
void StartFileThread() {
file_thread_.StartWithOptions(
- base::Thread::Options(MessageLoop::TYPE_DEFAULT, 0));
+ base::Thread::Options(MessageLoop::TYPE_IO, 0));
}
MessageLoop* file_message_loop() {
@@ -194,13 +194,17 @@ URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams()
URLRequestContextBuilder::URLRequestContextBuilder()
: ftp_enabled_(false),
+#if defined(OS_LINUX)
+ glib_task_runner_(NULL),
+#endif // defined(OS_LINUX)
http_cache_enabled_(true) {}
+
URLRequestContextBuilder::~URLRequestContextBuilder() {}
#if defined(OS_LINUX)
-void URLRequestContextBuilder::set_proxy_config_service(
- ProxyConfigService* proxy_config_service) {
- proxy_config_service_.reset(proxy_config_service);
+void URLRequestContextBuilder::set_glib_task_runner(
+ base::SingleThreadTaskRunner* glib_task_runner) {
+ glib_task_runner_ = glib_task_runner;
}
#endif // defined(OS_LINUX)
@@ -225,19 +229,15 @@ URLRequestContext* URLRequestContextBuilder::Build() {
context->StartFileThread();
- // TODO(willchan): Switch to using this code when
- // ProxyService::CreateSystemProxyConfigService()'s signature doesn't suck.
+ storage->set_proxy_service(
+ ProxyService::CreateUsingSystemProxyResolver(
+ ProxyService::CreateSystemProxyConfigService(
#if defined(OS_LINUX)
- ProxyConfigService* proxy_config_service = proxy_config_service_.release();
+ glib_task_runner_,
#else
- ProxyConfigService* proxy_config_service =
- ProxyService::CreateSystemProxyConfigService(
- base::ThreadTaskRunnerHandle::Get(),
- context->file_message_loop());
+ NULL,
#endif // defined(OS_LINUX)
- storage->set_proxy_service(
- ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service,
+ context->file_message_loop()),
4, // TODO(willchan): Find a better constant somewhere.
context->net_log()));
storage->set_ssl_config_service(new net::SSLConfigServiceDefaults);

Powered by Google App Engine
This is Rietveld 408576698