| 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/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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/certificate_report_sender.h" | 76 #include "net/url_request/certificate_report_sender.h" |
| 77 #include "net/url_request/data_protocol_handler.h" | 77 #include "net/url_request/data_protocol_handler.h" |
| 78 #include "net/url_request/file_protocol_handler.h" | 78 #include "net/url_request/file_protocol_handler.h" |
| 79 #include "net/url_request/ftp_protocol_handler.h" | 79 #include "net/url_request/ftp_protocol_handler.h" |
| 80 #include "net/url_request/url_request.h" | 80 #include "net/url_request/url_request.h" |
| 81 #include "net/url_request/url_request_context.h" | 81 #include "net/url_request/url_request_context.h" |
| 82 #include "net/url_request/url_request_context_builder.h" |
| 82 #include "net/url_request/url_request_file_job.h" | 83 #include "net/url_request/url_request_file_job.h" |
| 83 #include "net/url_request/url_request_intercepting_job_factory.h" | 84 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 84 #include "net/url_request/url_request_interceptor.h" | 85 #include "net/url_request/url_request_interceptor.h" |
| 85 #include "net/url_request/url_request_job_factory_impl.h" | 86 #include "net/url_request/url_request_job_factory_impl.h" |
| 86 | 87 |
| 87 #if defined(ENABLE_CONFIGURATION_POLICY) | 88 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 88 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" | 89 #include "chrome/browser/policy/cloud/policy_header_service_factory.h" |
| 89 #include "chrome/browser/policy/policy_helpers.h" | 90 #include "chrome/browser/policy/policy_helpers.h" |
| 90 #include "components/policy/core/browser/url_blacklist_manager.h" | 91 #include "components/policy/core/browser/url_blacklist_manager.h" |
| 91 #include "components/policy/core/common/cloud/policy_header_io_helper.h" | 92 #include "components/policy/core/common/cloud/policy_header_io_helper.h" |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 | 1290 |
| 1290 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( | 1291 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( |
| 1291 const ProfileParams* profile_params, | 1292 const ProfileParams* profile_params, |
| 1292 net::HttpCache::BackendFactory* main_backend) const { | 1293 net::HttpCache::BackendFactory* main_backend) const { |
| 1293 net::HttpNetworkSession::Params params; | 1294 net::HttpNetworkSession::Params params; |
| 1294 net::URLRequestContext* context = main_request_context(); | 1295 net::URLRequestContext* context = main_request_context(); |
| 1295 | 1296 |
| 1296 IOThread* const io_thread = profile_params->io_thread; | 1297 IOThread* const io_thread = profile_params->io_thread; |
| 1297 | 1298 |
| 1298 io_thread->InitializeNetworkSessionParams(¶ms); | 1299 io_thread->InitializeNetworkSessionParams(¶ms); |
| 1300 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, |
| 1301 ¶ms); |
| 1299 | 1302 |
| 1300 params.host_resolver = context->host_resolver(); | |
| 1301 params.cert_verifier = context->cert_verifier(); | |
| 1302 params.channel_id_service = context->channel_id_service(); | |
| 1303 params.transport_security_state = context->transport_security_state(); | |
| 1304 params.cert_transparency_verifier = context->cert_transparency_verifier(); | |
| 1305 params.proxy_service = context->proxy_service(); | |
| 1306 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); | 1303 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); |
| 1307 params.ssl_config_service = context->ssl_config_service(); | |
| 1308 params.http_auth_handler_factory = context->http_auth_handler_factory(); | |
| 1309 params.network_delegate = context->network_delegate(); | |
| 1310 params.http_server_properties = context->http_server_properties(); | |
| 1311 params.net_log = context->net_log(); | |
| 1312 if (data_reduction_proxy_io_data_.get()) | 1304 if (data_reduction_proxy_io_data_.get()) |
| 1313 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); | 1305 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); |
| 1314 | 1306 |
| 1315 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); | 1307 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); |
| 1316 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1308 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
| 1317 new DevToolsNetworkTransactionFactory( | 1309 new DevToolsNetworkTransactionFactory( |
| 1318 network_controller_handle_.GetController(), session), | 1310 network_controller_handle_.GetController(), session), |
| 1319 context->net_log(), main_backend)); | 1311 context->net_log(), main_backend)); |
| 1320 } | 1312 } |
| 1321 | 1313 |
| 1322 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( | 1314 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( |
| 1323 net::HttpNetworkSession* shared_session, | 1315 net::HttpNetworkSession* shared_session, |
| 1324 net::HttpCache::BackendFactory* backend) const { | 1316 net::HttpCache::BackendFactory* backend) const { |
| 1325 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1317 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
| 1326 new DevToolsNetworkTransactionFactory( | 1318 new DevToolsNetworkTransactionFactory( |
| 1327 network_controller_handle_.GetController(), shared_session), | 1319 network_controller_handle_.GetController(), shared_session), |
| 1328 shared_session->net_log(), backend)); | 1320 shared_session->net_log(), backend)); |
| 1329 } | 1321 } |
| 1330 | 1322 |
| 1331 void ProfileIOData::SetCookieSettingsForTesting( | 1323 void ProfileIOData::SetCookieSettingsForTesting( |
| 1332 content_settings::CookieSettings* cookie_settings) { | 1324 content_settings::CookieSettings* cookie_settings) { |
| 1333 DCHECK(!cookie_settings_.get()); | 1325 DCHECK(!cookie_settings_.get()); |
| 1334 cookie_settings_ = cookie_settings; | 1326 cookie_settings_ = cookie_settings; |
| 1335 } | 1327 } |
| OLD | NEW |