| 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 451 } |
| 452 | 452 |
| 453 void ChromeBrowserStateIOData::set_channel_id_service( | 453 void ChromeBrowserStateIOData::set_channel_id_service( |
| 454 net::ChannelIDService* channel_id_service) const { | 454 net::ChannelIDService* channel_id_service) const { |
| 455 channel_id_service_.reset(channel_id_service); | 455 channel_id_service_.reset(channel_id_service); |
| 456 } | 456 } |
| 457 | 457 |
| 458 std::unique_ptr<net::HttpNetworkSession> | 458 std::unique_ptr<net::HttpNetworkSession> |
| 459 ChromeBrowserStateIOData::CreateHttpNetworkSession( | 459 ChromeBrowserStateIOData::CreateHttpNetworkSession( |
| 460 const ProfileParams& profile_params) const { | 460 const ProfileParams& profile_params) const { |
| 461 net::HttpNetworkSession::Params params; | |
| 462 net::URLRequestContext* context = main_request_context(); | 461 net::URLRequestContext* context = main_request_context(); |
| 463 | 462 |
| 464 IOSChromeIOThread* const io_thread = profile_params.io_thread; | 463 IOSChromeIOThread* const io_thread = profile_params.io_thread; |
| 465 | 464 |
| 466 io_thread->InitializeNetworkSessionParams(¶ms); | 465 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams()); |
| 467 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, | 466 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, |
| 468 ¶ms); | 467 ¶ms); |
| 469 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { | 468 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { |
| 470 params.socket_performance_watcher_factory = | 469 params.socket_performance_watcher_factory = |
| 471 io_thread->globals() | 470 io_thread->globals() |
| 472 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); | 471 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); |
| 473 } | 472 } |
| 474 | 473 |
| 475 return std::unique_ptr<net::HttpNetworkSession>( | 474 return std::unique_ptr<net::HttpNetworkSession>( |
| 476 new net::HttpNetworkSession(params)); | 475 new net::HttpNetworkSession(params)); |
| 477 } | 476 } |
| 478 | 477 |
| 479 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( | 478 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( |
| 480 net::HttpNetworkSession* session, | 479 net::HttpNetworkSession* session, |
| 481 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { | 480 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { |
| 482 return std::unique_ptr<net::HttpCache>( | 481 return std::unique_ptr<net::HttpCache>( |
| 483 new net::HttpCache(session, std::move(main_backend), true)); | 482 new net::HttpCache(session, std::move(main_backend), true)); |
| 484 } | 483 } |
| 485 | 484 |
| 486 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 485 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
| 487 net::HttpNetworkSession* shared_session, | 486 net::HttpNetworkSession* shared_session, |
| 488 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 487 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
| 489 return std::unique_ptr<net::HttpCache>( | 488 return std::unique_ptr<net::HttpCache>( |
| 490 new net::HttpCache(shared_session, std::move(backend), true)); | 489 new net::HttpCache(shared_session, std::move(backend), true)); |
| 491 } | 490 } |
| OLD | NEW |