OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/io_thread.h" | 5 #include "chrome/browser/io_thread.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 "466432 IOThread::InitAsync::CertPolicyEnforcer")); | 674 "466432 IOThread::InitAsync::CertPolicyEnforcer")); |
675 net::CertPolicyEnforcer* policy_enforcer = new net::CertPolicyEnforcer; | 675 net::CertPolicyEnforcer* policy_enforcer = new net::CertPolicyEnforcer; |
676 globals_->cert_policy_enforcer.reset(policy_enforcer); | 676 globals_->cert_policy_enforcer.reset(policy_enforcer); |
677 | 677 |
678 globals_->ssl_config_service = GetSSLConfigService(); | 678 globals_->ssl_config_service = GetSSLConfigService(); |
679 | 679 |
680 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( | 680 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( |
681 globals_->host_resolver.get())); | 681 globals_->host_resolver.get())); |
682 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); | 682 globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); |
683 // For the ProxyScriptFetcher, we use a direct ProxyService. | 683 // For the ProxyScriptFetcher, we use a direct ProxyService. |
684 globals_->proxy_script_fetcher_proxy_service.reset( | 684 globals_->proxy_script_fetcher_proxy_service = |
685 net::ProxyService::CreateDirectWithNetLog(net_log_)); | 685 net::ProxyService::CreateDirectWithNetLog(net_log_); |
686 // In-memory cookie store. | 686 // In-memory cookie store. |
687 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 687 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
688 // is fixed. | 688 // is fixed. |
689 tracked_objects::ScopedTracker tracking_profile11( | 689 tracked_objects::ScopedTracker tracking_profile11( |
690 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 690 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
691 "466432 IOThread::InitAsync::CreateCookieStore::Start")); | 691 "466432 IOThread::InitAsync::CreateCookieStore::Start")); |
692 globals_->system_cookie_store = | 692 globals_->system_cookie_store = |
693 content::CreateCookieStore(content::CookieStoreConfig()); | 693 content::CreateCookieStore(content::CookieStoreConfig()); |
694 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 | 694 // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 |
695 // is fixed. | 695 // is fixed. |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 base::Unretained(this))); | 1083 base::Unretained(this))); |
1084 } | 1084 } |
1085 | 1085 |
1086 void IOThread::InitSystemRequestContextOnIOThread() { | 1086 void IOThread::InitSystemRequestContextOnIOThread() { |
1087 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1087 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1088 DCHECK(!globals_->system_proxy_service.get()); | 1088 DCHECK(!globals_->system_proxy_service.get()); |
1089 DCHECK(system_proxy_config_service_.get()); | 1089 DCHECK(system_proxy_config_service_.get()); |
1090 | 1090 |
1091 const base::CommandLine& command_line = | 1091 const base::CommandLine& command_line = |
1092 *base::CommandLine::ForCurrentProcess(); | 1092 *base::CommandLine::ForCurrentProcess(); |
1093 globals_->system_proxy_service.reset( | 1093 globals_->system_proxy_service = ProxyServiceFactory::CreateProxyService( |
1094 ProxyServiceFactory::CreateProxyService( | 1094 net_log_, globals_->proxy_script_fetcher_context.get(), |
1095 net_log_, | 1095 globals_->system_network_delegate.get(), |
1096 globals_->proxy_script_fetcher_context.get(), | 1096 system_proxy_config_service_.release(), command_line, |
1097 globals_->system_network_delegate.get(), | 1097 quick_check_enabled_.GetValue()); |
1098 system_proxy_config_service_.release(), | |
1099 command_line, | |
1100 quick_check_enabled_.GetValue())); | |
1101 | 1098 |
1102 globals_->system_request_context.reset( | 1099 globals_->system_request_context.reset( |
1103 ConstructSystemRequestContext(globals_, net_log_)); | 1100 ConstructSystemRequestContext(globals_, net_log_)); |
1104 } | 1101 } |
1105 | 1102 |
1106 void IOThread::UpdateDnsClientEnabled() { | 1103 void IOThread::UpdateDnsClientEnabled() { |
1107 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); | 1104 globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); |
1108 } | 1105 } |
1109 | 1106 |
1110 void IOThread::ConfigureQuic(const base::CommandLine& command_line) { | 1107 void IOThread::ConfigureQuic(const base::CommandLine& command_line) { |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); | 1578 globals->proxy_script_fetcher_url_request_job_factory = job_factory.Pass(); |
1582 | 1579 |
1583 context->set_job_factory( | 1580 context->set_job_factory( |
1584 globals->proxy_script_fetcher_url_request_job_factory.get()); | 1581 globals->proxy_script_fetcher_url_request_job_factory.get()); |
1585 | 1582 |
1586 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the | 1583 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
1587 // system URLRequestContext too. There's no reason this should be tied to a | 1584 // system URLRequestContext too. There's no reason this should be tied to a |
1588 // profile. | 1585 // profile. |
1589 return context; | 1586 return context; |
1590 } | 1587 } |
OLD | NEW |