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

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

Issue 1288383002: Use common code to set HttpNetworkSession::Param pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to r345348. Created 5 years, 4 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/io_thread.cc ('k') | net/url_request/url_request_context_builder.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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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(&params); 1299 io_thread->InitializeNetworkSessionParams(&params);
1300 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context,
1301 &params);
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 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698