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

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

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | components/gcm_driver/gcm_client.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #include "components/sync_driver/pref_names.h" 60 #include "components/sync_driver/pref_names.h"
61 #include "components/url_formatter/url_fixer.h" 61 #include "components/url_formatter/url_fixer.h"
62 #include "content/public/browser/browser_thread.h" 62 #include "content/public/browser/browser_thread.h"
63 #include "content/public/browser/host_zoom_map.h" 63 #include "content/public/browser/host_zoom_map.h"
64 #include "content/public/browser/notification_service.h" 64 #include "content/public/browser/notification_service.h"
65 #include "content/public/browser/resource_context.h" 65 #include "content/public/browser/resource_context.h"
66 #include "net/base/keygen_handler.h" 66 #include "net/base/keygen_handler.h"
67 #include "net/base/network_quality_estimator.h" 67 #include "net/base/network_quality_estimator.h"
68 #include "net/cert/cert_verifier.h" 68 #include "net/cert/cert_verifier.h"
69 #include "net/cookies/canonical_cookie.h" 69 #include "net/cookies/canonical_cookie.h"
70 #include "net/http/http_network_session.h"
70 #include "net/http/http_transaction_factory.h" 71 #include "net/http/http_transaction_factory.h"
71 #include "net/http/http_util.h" 72 #include "net/http/http_util.h"
72 #include "net/http/transport_security_persister.h" 73 #include "net/http/transport_security_persister.h"
73 #include "net/proxy/proxy_config_service_fixed.h" 74 #include "net/proxy/proxy_config_service_fixed.h"
74 #include "net/proxy/proxy_script_fetcher_impl.h" 75 #include "net/proxy/proxy_script_fetcher_impl.h"
75 #include "net/proxy/proxy_service.h" 76 #include "net/proxy/proxy_service.h"
76 #include "net/ssl/channel_id_service.h" 77 #include "net/ssl/channel_id_service.h"
77 #include "net/ssl/client_cert_store.h" 78 #include "net/ssl/client_cert_store.h"
78 #include "net/url_request/certificate_report_sender.h" 79 #include "net/url_request/certificate_report_sender.h"
79 #include "net/url_request/data_protocol_handler.h" 80 #include "net/url_request/data_protocol_handler.h"
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 1294
1294 void ProfileIOData::set_channel_id_service( 1295 void ProfileIOData::set_channel_id_service(
1295 net::ChannelIDService* channel_id_service) const { 1296 net::ChannelIDService* channel_id_service) const {
1296 channel_id_service_.reset(channel_id_service); 1297 channel_id_service_.reset(channel_id_service);
1297 } 1298 }
1298 1299
1299 void ProfileIOData::DestroyResourceContext() { 1300 void ProfileIOData::DestroyResourceContext() {
1300 resource_context_.reset(); 1301 resource_context_.reset();
1301 } 1302 }
1302 1303
1303 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( 1304 scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession(
1304 const ProfileParams* profile_params, 1305 const ProfileParams& profile_params) const {
1305 net::HttpCache::BackendFactory* main_backend) const {
1306 net::HttpNetworkSession::Params params; 1306 net::HttpNetworkSession::Params params;
1307 net::URLRequestContext* context = main_request_context(); 1307 net::URLRequestContext* context = main_request_context();
1308 1308
1309 IOThread* const io_thread = profile_params->io_thread; 1309 IOThread* const io_thread = profile_params.io_thread;
1310 1310
1311 io_thread->InitializeNetworkSessionParams(&params); 1311 io_thread->InitializeNetworkSessionParams(&params);
1312 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, 1312 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context,
1313 &params); 1313 &params);
1314 1314
1315 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); 1315 params.ssl_session_cache_shard = GetSSLSessionCacheShard();
1316 if (!IsOffTheRecord()) { 1316 if (!IsOffTheRecord()) {
1317 params.socket_performance_watcher_factory = 1317 params.socket_performance_watcher_factory =
1318 io_thread->globals()->network_quality_estimator.get(); 1318 io_thread->globals()->network_quality_estimator.get();
1319 } 1319 }
1320 if (data_reduction_proxy_io_data_.get()) 1320 if (data_reduction_proxy_io_data_.get())
1321 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); 1321 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate();
1322 1322
1323 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); 1323 return scoped_ptr<net::HttpNetworkSession>(
1324 new net::HttpNetworkSession(params));
1325 }
1326
1327 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
1328 net::HttpNetworkSession* session,
1329 net::HttpCache::BackendFactory* main_backend) const {
1330 net::URLRequestContext* context = main_request_context();
1324 return scoped_ptr<net::HttpCache>(new net::HttpCache( 1331 return scoped_ptr<net::HttpCache>(new net::HttpCache(
1325 new DevToolsNetworkTransactionFactory( 1332 new DevToolsNetworkTransactionFactory(
1326 network_controller_handle_.GetController(), session), 1333 network_controller_handle_.GetController(), session),
1327 context->net_log(), main_backend)); 1334 context->net_log(), main_backend,
1335 true /* set_up_quic_server_info */));
1328 } 1336 }
1329 1337
1330 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( 1338 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory(
1331 net::HttpNetworkSession* shared_session, 1339 net::HttpNetworkSession* shared_session,
1332 net::HttpCache::BackendFactory* backend) const { 1340 net::HttpCache::BackendFactory* backend) const {
1333 return scoped_ptr<net::HttpCache>(new net::HttpCache( 1341 return scoped_ptr<net::HttpCache>(new net::HttpCache(
1334 new DevToolsNetworkTransactionFactory( 1342 new DevToolsNetworkTransactionFactory(
1335 network_controller_handle_.GetController(), shared_session), 1343 network_controller_handle_.GetController(), shared_session),
1336 shared_session->net_log(), backend)); 1344 shared_session->net_log(), backend,
1345 true /* set_up_quic_server_info */));
1337 } 1346 }
1338 1347
1339 void ProfileIOData::SetCookieSettingsForTesting( 1348 void ProfileIOData::SetCookieSettingsForTesting(
1340 content_settings::CookieSettings* cookie_settings) { 1349 content_settings::CookieSettings* cookie_settings) {
1341 DCHECK(!cookie_settings_.get()); 1350 DCHECK(!cookie_settings_.get());
1342 cookie_settings_ = cookie_settings; 1351 cookie_settings_ = cookie_settings;
1343 } 1352 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.h ('k') | components/gcm_driver/gcm_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698