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

Side by Side Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1239393003: Refactor main URLRequestContext creation to use URLRequestContextBuilder Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/profiles/profile_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "net/proxy/proxy_config_service_fixed.h" 71 #include "net/proxy/proxy_config_service_fixed.h"
72 #include "net/proxy/proxy_script_fetcher_impl.h" 72 #include "net/proxy/proxy_script_fetcher_impl.h"
73 #include "net/proxy/proxy_service.h" 73 #include "net/proxy/proxy_service.h"
74 #include "net/ssl/channel_id_service.h" 74 #include "net/ssl/channel_id_service.h"
75 #include "net/ssl/client_cert_store.h" 75 #include "net/ssl/client_cert_store.h"
76 #include "net/url_request/data_protocol_handler.h" 76 #include "net/url_request/data_protocol_handler.h"
77 #include "net/url_request/file_protocol_handler.h" 77 #include "net/url_request/file_protocol_handler.h"
78 #include "net/url_request/ftp_protocol_handler.h" 78 #include "net/url_request/ftp_protocol_handler.h"
79 #include "net/url_request/url_request.h" 79 #include "net/url_request/url_request.h"
80 #include "net/url_request/url_request_context.h" 80 #include "net/url_request/url_request_context.h"
81 #include "net/url_request/url_request_context_builder.h"
82 #include "net/url_request/url_request_context_storage.h"
81 #include "net/url_request/url_request_file_job.h" 83 #include "net/url_request/url_request_file_job.h"
82 #include "net/url_request/url_request_intercepting_job_factory.h" 84 #include "net/url_request/url_request_intercepting_job_factory.h"
83 #include "net/url_request/url_request_interceptor.h" 85 #include "net/url_request/url_request_interceptor.h"
84 #include "net/url_request/url_request_job_factory_impl.h" 86 #include "net/url_request/url_request_job_factory_impl.h"
85 87
86 #if defined(ENABLE_CONFIGURATION_POLICY) 88 #if defined(ENABLE_CONFIGURATION_POLICY)
87 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" 89 #include "chrome/browser/policy/cloud/policy_header_service_factory.h"
88 #include "chrome/browser/policy/policy_helpers.h" 90 #include "chrome/browser/policy/policy_helpers.h"
89 #include "components/policy/core/browser/url_blacklist_manager.h" 91 #include "components/policy/core/browser/url_blacklist_manager.h"
90 #include "components/policy/core/common/cloud/policy_header_io_helper.h" 92 #include "components/policy/core/common/cloud/policy_header_io_helper.h"
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 return data_reduction_proxy_io_data() && 879 return data_reduction_proxy_io_data() &&
878 data_reduction_proxy_io_data()->IsEnabled(); 880 data_reduction_proxy_io_data()->IsEnabled();
879 } 881 }
880 882
881 void ProfileIOData::set_data_reduction_proxy_io_data( 883 void ProfileIOData::set_data_reduction_proxy_io_data(
882 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> 884 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData>
883 data_reduction_proxy_io_data) const { 885 data_reduction_proxy_io_data) const {
884 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass(); 886 data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass();
885 } 887 }
886 888
889 net::FraudulentCertificateReporter*
890 ProfileIOData::fraudulent_certificate_reporter() const {
891 return main_request_context_.get()
892 ? main_request_context_->storage()
893 ->fraudulent_certificate_reporter()
894 : nullptr;
895 }
896
897 net::TransportSecurityState* ProfileIOData::transport_security_state() const {
898 return main_request_context_.get()
899 ? main_request_context_->storage()->transport_security_state()
900 : nullptr;
901 }
902
887 base::WeakPtr<net::HttpServerProperties> 903 base::WeakPtr<net::HttpServerProperties>
888 ProfileIOData::http_server_properties() const { 904 ProfileIOData::http_server_properties() const {
889 return http_server_properties_->GetWeakPtr(); 905 return http_server_properties_->GetWeakPtr();
890 } 906 }
891 907
892 void ProfileIOData::set_http_server_properties( 908 void ProfileIOData::set_http_server_properties(
893 scoped_ptr<net::HttpServerProperties> http_server_properties) const { 909 scoped_ptr<net::HttpServerProperties> http_server_properties) const {
894 http_server_properties_ = http_server_properties.Pass(); 910 http_server_properties_ = http_server_properties.Pass();
895 } 911 }
896 912
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 std::string ProfileIOData::GetSSLSessionCacheShard() { 994 std::string ProfileIOData::GetSSLSessionCacheShard() {
979 DCHECK_CURRENTLY_ON(BrowserThread::IO); 995 DCHECK_CURRENTLY_ON(BrowserThread::IO);
980 // The SSL session cache is partitioned by setting a string. This returns a 996 // The SSL session cache is partitioned by setting a string. This returns a
981 // unique string to partition the SSL session cache. Each time we create a 997 // unique string to partition the SSL session cache. Each time we create a
982 // new profile, we'll get a fresh SSL session cache which is separate from 998 // new profile, we'll get a fresh SSL session cache which is separate from
983 // the other profiles. 999 // the other profiles.
984 static unsigned ssl_session_cache_instance = 0; 1000 static unsigned ssl_session_cache_instance = 0;
985 return base::StringPrintf("profile/%u", ssl_session_cache_instance++); 1001 return base::StringPrintf("profile/%u", ssl_session_cache_instance++);
986 } 1002 }
987 1003
1004 namespace {
1005
1006 class ChromeFraudulentCertificateReporterFactory
1007 : public net::FraudulentCertificateReporterFactory {
1008 public:
1009 net::FraudulentCertificateReporter* Create(
1010 net::URLRequestContext* context) const override {
1011 return new ChromeFraudulentCertificateReporter(context);
1012 }
1013 };
1014
1015 }
1016
1017 net::CertVerifier* ProfileIOData::CertVerifierDelegateMainContext::Get(
1018 net::URLRequestContext* context) {
1019 return owner_->GetCertVerifierForMainContext(context);
1020 }
1021
1022 net::HttpTransactionFactory*
1023 ProfileIOData::HttpTransactionFactoryDelegate::Create(
1024 net::URLRequestContext* context) {
1025 return owner_->CreateMainHttpFactory(
1026 profile_params_, main_backend_, context).release();
1027 }
1028
988 void ProfileIOData::Init( 1029 void ProfileIOData::Init(
989 content::ProtocolHandlerMap* protocol_handlers, 1030 content::ProtocolHandlerMap* protocol_handlers,
990 content::URLRequestInterceptorScopedVector request_interceptors) const { 1031 content::URLRequestInterceptorScopedVector request_interceptors) const {
991 // The basic logic is implemented here. The specific initialization 1032 // The basic logic is implemented here. The specific initialization
992 // is done in InitializeInternal(), implemented by subtypes. Static helper 1033 // is done in InitializeInternal(), implemented by subtypes. Static helper
993 // functions have been provided to assist in common operations. 1034 // functions have been provided to assist in common operations.
994 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1035 DCHECK_CURRENTLY_ON(BrowserThread::IO);
995 DCHECK(!initialized_); 1036 DCHECK(!initialized_);
996 1037
997 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. 1038 // TODO(jhawkins): Remove once crbug.com/102004 is fixed.
998 CHECK(initialized_on_UI_thread_); 1039 CHECK(initialized_on_UI_thread_);
999 1040
1000 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed. 1041 // TODO(jhawkins): Return to DCHECK once crbug.com/102004 is fixed.
1001 CHECK(profile_params_.get()); 1042 CHECK(profile_params_.get());
1002 1043
1003 IOThread* const io_thread = profile_params_->io_thread; 1044 IOThread* const io_thread = profile_params_->io_thread;
1004 IOThread::Globals* const io_thread_globals = io_thread->globals(); 1045 IOThread::Globals* const io_thread_globals = io_thread->globals();
1005 const base::CommandLine& command_line = 1046 const base::CommandLine& command_line =
1006 *base::CommandLine::ForCurrentProcess(); 1047 *base::CommandLine::ForCurrentProcess();
1007 1048
1008 // Create the common request contexts. 1049 // Create the common request contexts.
1009 main_request_context_.reset(new net::URLRequestContext()); 1050 net::URLRequestContextBuilder context_builder;
1010 extensions_request_context_.reset(new net::URLRequestContext()); 1051 extensions_request_context_.reset(new net::URLRequestContext());
1011 1052
1012 scoped_ptr<ChromeNetworkDelegate> network_delegate( 1053 scoped_ptr<ChromeNetworkDelegate> network_delegate(
1013 new ChromeNetworkDelegate( 1054 new ChromeNetworkDelegate(
1014 #if defined(ENABLE_EXTENSIONS) 1055 #if defined(ENABLE_EXTENSIONS)
1015 io_thread_globals->extension_event_router_forwarder.get(), 1056 io_thread_globals->extension_event_router_forwarder.get(),
1016 #else 1057 #else
1017 NULL, 1058 NULL,
1018 #endif 1059 #endif
1019 &enable_referrers_)); 1060 &enable_referrers_));
1020 #if defined(ENABLE_EXTENSIONS) 1061 #if defined(ENABLE_EXTENSIONS)
1021 network_delegate->set_extension_info_map( 1062 network_delegate->set_extension_info_map(
1022 profile_params_->extension_info_map.get()); 1063 profile_params_->extension_info_map.get());
1023 if (!command_line.HasSwitch(switches::kDisableExtensionsHttpThrottling)) { 1064 if (!command_line.HasSwitch(switches::kDisableExtensionsHttpThrottling)) {
1024 extension_throttle_manager_.reset( 1065 extension_throttle_manager_.reset(
1025 new extensions::ExtensionThrottleManager()); 1066 new extensions::ExtensionThrottleManager());
1026 } 1067 }
1027 #endif 1068 #endif
1028 1069
1029 #if defined(ENABLE_CONFIGURATION_POLICY) 1070 #if defined(ENABLE_CONFIGURATION_POLICY)
1030 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get()); 1071 network_delegate->set_url_blacklist_manager(url_blacklist_manager_.get());
1031 #endif 1072 #endif
1032 network_delegate->set_profile(profile_params_->profile); 1073 network_delegate->set_profile(profile_params_->profile);
1033 network_delegate->set_profile_path(profile_params_->path); 1074 network_delegate->set_profile_path(profile_params_->path);
1034 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get()); 1075 network_delegate->set_cookie_settings(profile_params_->cookie_settings.get());
1035 network_delegate->set_enable_do_not_track(&enable_do_not_track_); 1076 network_delegate->set_enable_do_not_track(&enable_do_not_track_);
1036 network_delegate->set_force_google_safe_search(&force_google_safesearch_); 1077 network_delegate->set_force_google_safe_search(&force_google_safesearch_);
1037 network_delegate->set_force_youtube_safety_mode(&force_youtube_safety_mode_); 1078 network_delegate->set_force_youtube_safety_mode(&force_youtube_safety_mode_);
1038 fraudulent_certificate_reporter_.reset( 1079
1039 new ChromeFraudulentCertificateReporter(main_request_context_.get())); 1080 context_builder.set_fraudulent_certificate_reporter_factory(
1081 new ChromeFraudulentCertificateReporterFactory);
1040 1082
1041 // NOTE: Proxy service uses the default io thread network delegate, not the 1083 // NOTE: Proxy service uses the default io thread network delegate, not the
1042 // delegate just created. 1084 // delegate just created.
1043 proxy_service_.reset( 1085 proxy_service_.reset(
1044 ProxyServiceFactory::CreateProxyService( 1086 ProxyServiceFactory::CreateProxyService(
1045 io_thread->net_log(), 1087 io_thread->net_log(),
1046 io_thread_globals->proxy_script_fetcher_context.get(), 1088 io_thread_globals->proxy_script_fetcher_context.get(),
1047 io_thread_globals->system_network_delegate.get(), 1089 io_thread_globals->system_network_delegate.get(),
1048 profile_params_->proxy_config_service.release(), 1090 profile_params_->proxy_config_service.release(),
1049 command_line, 1091 command_line,
1050 quick_check_enabled_.GetValue())); 1092 quick_check_enabled_.GetValue()));
1051 transport_security_state_.reset(new net::TransportSecurityState()); 1093 context_builder.set_transport_security_state(
1052 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 1094 new net::TransportSecurityState());
1053 transport_security_persister_.reset(
1054 new net::TransportSecurityPersister(
1055 transport_security_state_.get(),
1056 profile_params_->path,
1057 pool->GetSequencedTaskRunnerWithShutdownBehavior(
1058 pool->GetSequenceToken(),
1059 base::SequencedWorkerPool::BLOCK_SHUTDOWN),
1060 IsOffTheRecord()));
1061 1095
1062 // Take ownership over these parameters. 1096 // Take ownership over these parameters.
1063 cookie_settings_ = profile_params_->cookie_settings; 1097 cookie_settings_ = profile_params_->cookie_settings;
1064 host_content_settings_map_ = profile_params_->host_content_settings_map; 1098 host_content_settings_map_ = profile_params_->host_content_settings_map;
1065 #if defined(ENABLE_EXTENSIONS) 1099 #if defined(ENABLE_EXTENSIONS)
1066 extension_info_map_ = profile_params_->extension_info_map; 1100 extension_info_map_ = profile_params_->extension_info_map;
1067 #endif 1101 #endif
1068 1102
1069 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
1070 resource_context_->request_context_ = main_request_context_.get();
1071
1072 if (profile_params_->resource_prefetch_predictor_observer_) { 1103 if (profile_params_->resource_prefetch_predictor_observer_) {
1073 resource_prefetch_predictor_observer_.reset( 1104 resource_prefetch_predictor_observer_.reset(
1074 profile_params_->resource_prefetch_predictor_observer_.release()); 1105 profile_params_->resource_prefetch_predictor_observer_.release());
1075 } 1106 }
1076 1107
1077 #if defined(ENABLE_SUPERVISED_USERS) 1108 #if defined(ENABLE_SUPERVISED_USERS)
1078 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; 1109 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter;
1079 #endif 1110 #endif
1080 1111
1112 context_builder.set_cert_verifier_delegate(
1113 new CertVerifierDelegateMainContext(this));
1114
1115 // Install the New Tab Page Interceptor.
1116 if (profile_params_->new_tab_page_interceptor.get()) {
1117 request_interceptors.push_back(
1118 profile_params_->new_tab_page_interceptor.release());
1119 }
1120
1121 // We save a copy of the network delegate pointer as it may be wrapped before
1122 // it is stored in the URLResourceContext, and we may need it during the
1123 // post setup init.
1124 ChromeNetworkDelegate* network_delegate_raw_ptr = network_delegate.get();
1125 InitializeInternal(
1126 network_delegate.Pass(), profile_params_.get(),
1127 protocol_handlers, request_interceptors.Pass(),
1128 &context_builder);
1129
1130 // Now that the builder is initialized, proceed with building the main
1131 // context.
1132 main_request_context_.reset(context_builder.BuildMainContext());
1133
1134 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
1135 transport_security_persister_.reset(new net::TransportSecurityPersister(
1136 main_request_context_->storage()->transport_security_state(),
1137 profile_params_->path,
1138 pool->GetSequencedTaskRunnerWithShutdownBehavior(
1139 pool->GetSequenceToken(), base::SequencedWorkerPool::BLOCK_SHUTDOWN),
1140 IsOffTheRecord()));
1141
1142 InitPostContextSetup(network_delegate_raw_ptr);
1143
1144 profile_params_.reset();
1145 initialized_ = true;
1146 }
1147
1148 net::CertVerifier* ProfileIOData::GetCertVerifierForMainContext(
1149 net::URLRequestContext* context) const {
1150 IOThread* const io_thread = profile_params_->io_thread;
1151 IOThread::Globals* const io_thread_globals = io_thread->globals();
1152
1153 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get();
1154 resource_context_->request_context_ = context;
1081 #if defined(OS_CHROMEOS) 1155 #if defined(OS_CHROMEOS)
1082 username_hash_ = profile_params_->username_hash; 1156 username_hash_ = profile_params_->username_hash;
1083 use_system_key_slot_ = profile_params_->use_system_key_slot; 1157 use_system_key_slot_ = profile_params_->use_system_key_slot;
1084 if (use_system_key_slot_) 1158 if (use_system_key_slot_)
1085 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); 1159 EnableNSSSystemKeySlotForResourceContext(resource_context_.get());
1086 1160
1087 crypto::ScopedPK11Slot public_slot = 1161 crypto::ScopedPK11Slot public_slot =
1088 crypto::GetPublicSlotForChromeOSUser(username_hash_); 1162 crypto::GetPublicSlotForChromeOSUser(username_hash_);
1089 // The private slot won't be ready by this point. It shouldn't be necessary 1163 // The private slot won't be ready by this point. It shouldn't be necessary
1090 // for cert trust purposes anyway. 1164 // for cert trust purposes anyway.
1091 scoped_refptr<net::CertVerifyProc> verify_proc( 1165 scoped_refptr<net::CertVerifyProc> verify_proc(
1092 new chromeos::CertVerifyProcChromeOS(public_slot.Pass())); 1166 new chromeos::CertVerifyProcChromeOS(public_slot.Pass()));
1093 if (policy_cert_verifier_) { 1167 if (policy_cert_verifier_) {
1094 DCHECK_EQ(policy_cert_verifier_, cert_verifier_.get()); 1168 DCHECK_EQ(policy_cert_verifier_, cert_verifier_.get());
1095 policy_cert_verifier_->InitializeOnIOThread(verify_proc); 1169 policy_cert_verifier_->InitializeOnIOThread(verify_proc);
1096 } else { 1170 } else {
1097 cert_verifier_.reset(new net::MultiThreadedCertVerifier(verify_proc.get())); 1171 cert_verifier_.reset(new net::MultiThreadedCertVerifier(verify_proc.get()));
1098 } 1172 }
1099 main_request_context_->set_cert_verifier(cert_verifier_.get()); 1173 return cert_verifier_.get();
1100 #else 1174 #else
1101 main_request_context_->set_cert_verifier( 1175 return io_thread_globals->cert_verifier.get();
1102 io_thread_globals->cert_verifier.get());
1103 #endif 1176 #endif
1104
1105 // Install the New Tab Page Interceptor.
1106 if (profile_params_->new_tab_page_interceptor.get()) {
1107 request_interceptors.push_back(
1108 profile_params_->new_tab_page_interceptor.release());
1109 }
1110
1111 InitializeInternal(
1112 network_delegate.Pass(), profile_params_.get(),
1113 protocol_handlers, request_interceptors.Pass());
1114
1115 profile_params_.reset();
1116 initialized_ = true;
1117 } 1177 }
1178 //#endif
1118 1179
1119 void ProfileIOData::ApplyProfileParamsToContext( 1180 void ProfileIOData::ApplyProfileParamsToContext(
1120 net::URLRequestContext* context) const { 1181 net::URLRequestContext* context) const {
1121 context->set_http_user_agent_settings( 1182 context->set_http_user_agent_settings(
1122 chrome_http_user_agent_settings_.get()); 1183 chrome_http_user_agent_settings_.get());
1123 context->set_ssl_config_service(profile_params_->ssl_config_service.get()); 1184 context->set_ssl_config_service(profile_params_->ssl_config_service.get());
1124 } 1185 }
1125 1186
1187 void ProfileIOData::ApplyProfileParamsToContext(
1188 net::URLRequestContextBuilder* context_builder) const {
1189 context_builder->set_http_user_agent_settings_unowned(
1190 chrome_http_user_agent_settings_.get());
1191 context_builder->set_ssl_config_service(
1192 profile_params_->ssl_config_service.get());
1193 }
1194
1126 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults( 1195 scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults(
1127 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory, 1196 scoped_ptr<net::URLRequestJobFactoryImpl> job_factory,
1128 content::URLRequestInterceptorScopedVector request_interceptors, 1197 content::URLRequestInterceptorScopedVector request_interceptors,
1129 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 1198 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
1130 protocol_handler_interceptor, 1199 protocol_handler_interceptor,
1131 net::NetworkDelegate* network_delegate, 1200 net::NetworkDelegate* network_delegate,
1132 net::FtpTransactionFactory* ftp_transaction_factory) const { 1201 net::FtpTransactionFactory* ftp_transaction_factory) const {
1133 // NOTE(willchan): Keep these protocol handlers in sync with 1202 // NOTE(willchan): Keep these protocol handlers in sync with
1134 // ProfileIOData::IsHandledProtocol(). 1203 // ProfileIOData::IsHandledProtocol().
1135 bool set_protocol = job_factory->SetProtocolHandler( 1204 bool set_protocol = job_factory->SetProtocolHandler(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1241 base::Bind(&NotifyContextGettersOfShutdownOnIO, 1310 base::Bind(&NotifyContextGettersOfShutdownOnIO,
1242 base::Passed(&context_getters))); 1311 base::Passed(&context_getters)));
1243 } 1312 }
1244 } 1313 }
1245 1314
1246 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this); 1315 bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
1247 if (!posted) 1316 if (!posted)
1248 delete this; 1317 delete this;
1249 } 1318 }
1250 1319
1251 void ProfileIOData::set_channel_id_service(
1252 net::ChannelIDService* channel_id_service) const {
1253 channel_id_service_.reset(channel_id_service);
1254 }
1255
1256 void ProfileIOData::DestroyResourceContext() { 1320 void ProfileIOData::DestroyResourceContext() {
1257 resource_context_.reset(); 1321 resource_context_.reset();
1258 } 1322 }
1259 1323
1260 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( 1324 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
1261 const ProfileParams* profile_params, 1325 const ProfileParams* profile_params,
1262 net::HttpCache::BackendFactory* main_backend) const { 1326 net::HttpCache::BackendFactory* main_backend,
1327 net::URLRequestContext* context) const {
1263 net::HttpNetworkSession::Params params; 1328 net::HttpNetworkSession::Params params;
1264 net::URLRequestContext* context = main_request_context();
1265 1329
1266 IOThread* const io_thread = profile_params->io_thread; 1330 IOThread* const io_thread = profile_params->io_thread;
1267 1331
1268 io_thread->InitializeNetworkSessionParams(&params); 1332 io_thread->InitializeNetworkSessionParams(&params);
1269 1333
1270 params.host_resolver = context->host_resolver(); 1334 params.host_resolver = context->host_resolver();
1271 params.cert_verifier = context->cert_verifier(); 1335 params.cert_verifier = context->cert_verifier();
1272 params.channel_id_service = context->channel_id_service(); 1336 params.channel_id_service = context->channel_id_service();
1273 params.transport_security_state = context->transport_security_state(); 1337 params.transport_security_state = context->transport_security_state();
1274 params.cert_transparency_verifier = context->cert_transparency_verifier(); 1338 params.cert_transparency_verifier = context->cert_transparency_verifier();
(...skipping 22 matching lines...) Expand all
1297 new DevToolsNetworkTransactionFactory( 1361 new DevToolsNetworkTransactionFactory(
1298 network_controller_.get(), shared_session), 1362 network_controller_.get(), shared_session),
1299 shared_session->net_log(), backend)); 1363 shared_session->net_log(), backend));
1300 } 1364 }
1301 1365
1302 void ProfileIOData::SetCookieSettingsForTesting( 1366 void ProfileIOData::SetCookieSettingsForTesting(
1303 content_settings::CookieSettings* cookie_settings) { 1367 content_settings::CookieSettings* cookie_settings) {
1304 DCHECK(!cookie_settings_.get()); 1368 DCHECK(!cookie_settings_.get());
1305 cookie_settings_ = cookie_settings; 1369 cookie_settings_ = cookie_settings;
1306 } 1370 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | net/url_request/url_request_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698