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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 } | 1302 } |
1303 } | 1303 } |
1304 | 1304 |
1305 std::unique_ptr<net::HttpNetworkSession> | 1305 std::unique_ptr<net::HttpNetworkSession> |
1306 ProfileIOData::CreateHttpNetworkSession( | 1306 ProfileIOData::CreateHttpNetworkSession( |
1307 const ProfileParams& profile_params) const { | 1307 const ProfileParams& profile_params) const { |
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 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); | 1312 net::HttpNetworkSession::Context session_context; |
1313 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, | 1313 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
1314 ¶ms); | 1314 context, &session_context); |
1315 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { | 1315 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { |
1316 params.socket_performance_watcher_factory = | 1316 session_context.socket_performance_watcher_factory = |
1317 io_thread->globals() | 1317 io_thread->globals() |
1318 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); | 1318 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); |
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 session_context.proxy_delegate = |
| 1322 data_reduction_proxy_io_data_->proxy_delegate(); |
| 1323 } |
1322 | 1324 |
1323 return std::unique_ptr<net::HttpNetworkSession>( | 1325 return std::unique_ptr<net::HttpNetworkSession>(new net::HttpNetworkSession( |
1324 new net::HttpNetworkSession(params)); | 1326 io_thread->NetworkSessionParams(), session_context)); |
1325 } | 1327 } |
1326 | 1328 |
1327 std::unique_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( | 1329 std::unique_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( |
1328 net::HttpNetworkSession* session, | 1330 net::HttpNetworkSession* session, |
1329 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { | 1331 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { |
1330 return base::MakeUnique<net::HttpCache>( | 1332 return base::MakeUnique<net::HttpCache>( |
1331 base::WrapUnique(new DevToolsNetworkTransactionFactory( | 1333 base::WrapUnique(new DevToolsNetworkTransactionFactory( |
1332 network_controller_handle_.GetController(), session)), | 1334 network_controller_handle_.GetController(), session)), |
1333 std::move(main_backend), true /* is_main_cache */); | 1335 std::move(main_backend), true /* is_main_cache */); |
1334 } | 1336 } |
(...skipping 19 matching lines...) Expand all Loading... |
1354 void ProfileIOData::SetCookieSettingsForTesting( | 1356 void ProfileIOData::SetCookieSettingsForTesting( |
1355 content_settings::CookieSettings* cookie_settings) { | 1357 content_settings::CookieSettings* cookie_settings) { |
1356 DCHECK(!cookie_settings_.get()); | 1358 DCHECK(!cookie_settings_.get()); |
1357 cookie_settings_ = cookie_settings; | 1359 cookie_settings_ = cookie_settings; |
1358 } | 1360 } |
1359 | 1361 |
1360 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1362 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
1361 const GURL& url) const { | 1363 const GURL& url) const { |
1362 return url_blacklist_manager_->GetURLBlacklistState(url); | 1364 return url_blacklist_manager_->GetURLBlacklistState(url); |
1363 } | 1365 } |
OLD | NEW |