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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "components/sync_driver/pref_names.h" | 59 #include "components/sync_driver/pref_names.h" |
60 #include "components/url_formatter/url_fixer.h" | 60 #include "components/url_formatter/url_fixer.h" |
61 #include "content/public/browser/browser_thread.h" | 61 #include "content/public/browser/browser_thread.h" |
62 #include "content/public/browser/host_zoom_map.h" | 62 #include "content/public/browser/host_zoom_map.h" |
63 #include "content/public/browser/notification_service.h" | 63 #include "content/public/browser/notification_service.h" |
64 #include "content/public/browser/resource_context.h" | 64 #include "content/public/browser/resource_context.h" |
65 #include "net/base/keygen_handler.h" | 65 #include "net/base/keygen_handler.h" |
66 #include "net/base/network_quality_estimator.h" | 66 #include "net/base/network_quality_estimator.h" |
67 #include "net/cert/cert_verifier.h" | 67 #include "net/cert/cert_verifier.h" |
68 #include "net/cookies/canonical_cookie.h" | 68 #include "net/cookies/canonical_cookie.h" |
69 #include "net/http/http_network_session.h" | |
70 #include "net/http/http_transaction_factory.h" | 69 #include "net/http/http_transaction_factory.h" |
71 #include "net/http/http_util.h" | 70 #include "net/http/http_util.h" |
72 #include "net/http/transport_security_persister.h" | 71 #include "net/http/transport_security_persister.h" |
73 #include "net/proxy/proxy_config_service_fixed.h" | 72 #include "net/proxy/proxy_config_service_fixed.h" |
74 #include "net/proxy/proxy_script_fetcher_impl.h" | 73 #include "net/proxy/proxy_script_fetcher_impl.h" |
75 #include "net/proxy/proxy_service.h" | 74 #include "net/proxy/proxy_service.h" |
76 #include "net/ssl/channel_id_service.h" | 75 #include "net/ssl/channel_id_service.h" |
77 #include "net/ssl/client_cert_store.h" | 76 #include "net/ssl/client_cert_store.h" |
78 #include "net/url_request/certificate_report_sender.h" | 77 #include "net/url_request/certificate_report_sender.h" |
79 #include "net/url_request/data_protocol_handler.h" | 78 #include "net/url_request/data_protocol_handler.h" |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 | 1294 |
1296 void ProfileIOData::set_channel_id_service( | 1295 void ProfileIOData::set_channel_id_service( |
1297 net::ChannelIDService* channel_id_service) const { | 1296 net::ChannelIDService* channel_id_service) const { |
1298 channel_id_service_.reset(channel_id_service); | 1297 channel_id_service_.reset(channel_id_service); |
1299 } | 1298 } |
1300 | 1299 |
1301 void ProfileIOData::DestroyResourceContext() { | 1300 void ProfileIOData::DestroyResourceContext() { |
1302 resource_context_.reset(); | 1301 resource_context_.reset(); |
1303 } | 1302 } |
1304 | 1303 |
1305 scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession( | 1304 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( |
1306 const ProfileParams& profile_params) const { | 1305 const ProfileParams* profile_params, |
| 1306 net::HttpCache::BackendFactory* main_backend) const { |
1307 net::HttpNetworkSession::Params params; | 1307 net::HttpNetworkSession::Params params; |
1308 net::URLRequestContext* context = main_request_context(); | 1308 net::URLRequestContext* context = main_request_context(); |
1309 | 1309 |
1310 IOThread* const io_thread = profile_params.io_thread; | 1310 IOThread* const io_thread = profile_params->io_thread; |
1311 | 1311 |
1312 io_thread->InitializeNetworkSessionParams(¶ms); | 1312 io_thread->InitializeNetworkSessionParams(¶ms); |
1313 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, | 1313 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, |
1314 ¶ms); | 1314 ¶ms); |
1315 | 1315 |
1316 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); | 1316 params.ssl_session_cache_shard = GetSSLSessionCacheShard(); |
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 if (data_reduction_proxy_io_data_.get()) | 1319 if (data_reduction_proxy_io_data_.get()) |
1320 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); | 1320 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); |
1321 | 1321 |
1322 return scoped_ptr<net::HttpNetworkSession>( | 1322 net::HttpNetworkSession* session = new net::HttpNetworkSession(params); |
1323 new net::HttpNetworkSession(params)); | |
1324 } | |
1325 | |
1326 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( | |
1327 net::HttpNetworkSession* session, | |
1328 net::HttpCache::BackendFactory* main_backend) const { | |
1329 net::URLRequestContext* context = main_request_context(); | |
1330 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1323 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
1331 new DevToolsNetworkTransactionFactory( | 1324 new DevToolsNetworkTransactionFactory( |
1332 network_controller_handle_.GetController(), session), | 1325 network_controller_handle_.GetController(), session), |
1333 context->net_log(), main_backend, | 1326 context->net_log(), main_backend)); |
1334 true /* set_up_quic_server_info */)); | |
1335 } | 1327 } |
1336 | 1328 |
1337 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( | 1329 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory( |
1338 net::HttpNetworkSession* shared_session, | 1330 net::HttpNetworkSession* shared_session, |
1339 net::HttpCache::BackendFactory* backend) const { | 1331 net::HttpCache::BackendFactory* backend) const { |
1340 return scoped_ptr<net::HttpCache>(new net::HttpCache( | 1332 return scoped_ptr<net::HttpCache>(new net::HttpCache( |
1341 new DevToolsNetworkTransactionFactory( | 1333 new DevToolsNetworkTransactionFactory( |
1342 network_controller_handle_.GetController(), shared_session), | 1334 network_controller_handle_.GetController(), shared_session), |
1343 shared_session->net_log(), backend, | 1335 shared_session->net_log(), backend)); |
1344 true /* set_up_quic_server_info */)); | |
1345 } | 1336 } |
1346 | 1337 |
1347 void ProfileIOData::SetCookieSettingsForTesting( | 1338 void ProfileIOData::SetCookieSettingsForTesting( |
1348 content_settings::CookieSettings* cookie_settings) { | 1339 content_settings::CookieSettings* cookie_settings) { |
1349 DCHECK(!cookie_settings_.get()); | 1340 DCHECK(!cookie_settings_.get()); |
1350 cookie_settings_ = cookie_settings; | 1341 cookie_settings_ = cookie_settings; |
1351 } | 1342 } |
OLD | NEW |