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 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1285 scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession( | 1285 scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession( |
1286 const ProfileParams& profile_params) const { | 1286 const ProfileParams& profile_params) const { |
1287 net::HttpNetworkSession::Params params; | 1287 net::HttpNetworkSession::Params params; |
1288 net::URLRequestContext* context = main_request_context(); | 1288 net::URLRequestContext* context = main_request_context(); |
1289 | 1289 |
1290 IOThread* const io_thread = profile_params.io_thread; | 1290 IOThread* const io_thread = profile_params.io_thread; |
1291 | 1291 |
1292 io_thread->InitializeNetworkSessionParams(¶ms); | 1292 io_thread->InitializeNetworkSessionParams(¶ms); |
1293 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, | 1293 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, |
1294 ¶ms); | 1294 ¶ms); |
1295 if (!IsOffTheRecord()) { | 1295 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { |
1296 params.socket_performance_watcher_factory = | 1296 params.socket_performance_watcher_factory = |
1297 io_thread->globals()->network_quality_estimator.get(); | 1297 io_thread->globals() |
1298 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); | |
mmenke
2016/04/05 15:45:38
If this is a global, should it be hooked up to the
tbansal1
2016/04/05 17:30:38
That makes sense. I should move this to URLRequest
| |
1298 } | 1299 } |
1299 if (data_reduction_proxy_io_data_.get()) | 1300 if (data_reduction_proxy_io_data_.get()) |
1300 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); | 1301 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); |
1301 | 1302 |
1302 return scoped_ptr<net::HttpNetworkSession>( | 1303 return scoped_ptr<net::HttpNetworkSession>( |
1303 new net::HttpNetworkSession(params)); | 1304 new net::HttpNetworkSession(params)); |
1304 } | 1305 } |
1305 | 1306 |
1306 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( | 1307 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( |
1307 net::HttpNetworkSession* session, | 1308 net::HttpNetworkSession* session, |
(...skipping 11 matching lines...) Expand all Loading... | |
1319 make_scoped_ptr(new DevToolsNetworkTransactionFactory( | 1320 make_scoped_ptr(new DevToolsNetworkTransactionFactory( |
1320 network_controller_handle_.GetController(), shared_session)), | 1321 network_controller_handle_.GetController(), shared_session)), |
1321 std::move(backend), true /* set_up_quic_server_info */)); | 1322 std::move(backend), true /* set_up_quic_server_info */)); |
1322 } | 1323 } |
1323 | 1324 |
1324 void ProfileIOData::SetCookieSettingsForTesting( | 1325 void ProfileIOData::SetCookieSettingsForTesting( |
1325 content_settings::CookieSettings* cookie_settings) { | 1326 content_settings::CookieSettings* cookie_settings) { |
1326 DCHECK(!cookie_settings_.get()); | 1327 DCHECK(!cookie_settings_.get()); |
1327 cookie_settings_ = cookie_settings; | 1328 cookie_settings_ = cookie_settings; |
1328 } | 1329 } |
OLD | NEW |