OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/browser_state/chrome_browser_state_io_data.h" | 5 #include "ios/chrome/browser/browser_state/chrome_browser_state_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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 channel_id_service_.reset(channel_id_service); | 477 channel_id_service_.reset(channel_id_service); |
478 } | 478 } |
479 | 479 |
480 std::unique_ptr<net::HttpNetworkSession> | 480 std::unique_ptr<net::HttpNetworkSession> |
481 ChromeBrowserStateIOData::CreateHttpNetworkSession( | 481 ChromeBrowserStateIOData::CreateHttpNetworkSession( |
482 const ProfileParams& profile_params) const { | 482 const ProfileParams& profile_params) const { |
483 net::URLRequestContext* context = main_request_context(); | 483 net::URLRequestContext* context = main_request_context(); |
484 | 484 |
485 IOSChromeIOThread* const io_thread = profile_params.io_thread; | 485 IOSChromeIOThread* const io_thread = profile_params.io_thread; |
486 | 486 |
487 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); | 487 net::HttpNetworkSession::Context session_context; |
488 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, | 488 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
489 ¶ms); | 489 context, &session_context); |
490 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { | 490 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { |
491 params.socket_performance_watcher_factory = | 491 session_context.socket_performance_watcher_factory = |
492 io_thread->globals() | 492 io_thread->globals() |
493 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); | 493 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); |
494 } | 494 } |
495 | 495 |
496 return std::unique_ptr<net::HttpNetworkSession>( | 496 return std::unique_ptr<net::HttpNetworkSession>(new net::HttpNetworkSession( |
497 new net::HttpNetworkSession(params)); | 497 io_thread->NetworkSessionParams(), session_context)); |
498 } | 498 } |
499 | 499 |
500 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( | 500 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( |
501 net::HttpNetworkSession* session, | 501 net::HttpNetworkSession* session, |
502 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { | 502 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { |
503 return std::unique_ptr<net::HttpCache>( | 503 return std::unique_ptr<net::HttpCache>( |
504 new net::HttpCache(session, std::move(main_backend), true)); | 504 new net::HttpCache(session, std::move(main_backend), true)); |
505 } | 505 } |
506 | 506 |
507 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 507 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
508 net::HttpNetworkSession* shared_session, | 508 net::HttpNetworkSession* shared_session, |
509 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 509 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
510 return std::unique_ptr<net::HttpCache>( | 510 return std::unique_ptr<net::HttpCache>( |
511 new net::HttpCache(shared_session, std::move(backend), true)); | 511 new net::HttpCache(shared_session, std::move(backend), true)); |
512 } | 512 } |
OLD | NEW |