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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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::Context session_context; | 487 net::HttpNetworkSession::Context session_context; |
488 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( | 488 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( |
489 context, &session_context); | 489 context, &session_context); |
490 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { | 490 DCHECK(io_thread->globals()->network_quality_estimator); |
mmenke
2017/06/07 21:31:25
Again, not sure we really get anything from this.
tbansal1
2017/06/08 05:01:49
Done.
| |
491 if (!IsOffTheRecord()) { | |
491 session_context.socket_performance_watcher_factory = | 492 session_context.socket_performance_watcher_factory = |
492 io_thread->globals() | 493 io_thread->globals() |
493 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); | 494 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); |
494 } | 495 } |
495 | 496 |
496 return std::unique_ptr<net::HttpNetworkSession>(new net::HttpNetworkSession( | 497 return std::unique_ptr<net::HttpNetworkSession>(new net::HttpNetworkSession( |
497 io_thread->NetworkSessionParams(), session_context)); | 498 io_thread->NetworkSessionParams(), session_context)); |
498 } | 499 } |
499 | 500 |
500 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( | 501 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( |
501 net::HttpNetworkSession* session, | 502 net::HttpNetworkSession* session, |
502 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { | 503 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { |
503 return std::unique_ptr<net::HttpCache>( | 504 return std::unique_ptr<net::HttpCache>( |
504 new net::HttpCache(session, std::move(main_backend), true)); | 505 new net::HttpCache(session, std::move(main_backend), true)); |
505 } | 506 } |
506 | 507 |
507 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 508 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
508 net::HttpNetworkSession* shared_session, | 509 net::HttpNetworkSession* shared_session, |
509 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 510 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
510 return std::unique_ptr<net::HttpCache>( | 511 return std::unique_ptr<net::HttpCache>( |
511 new net::HttpCache(shared_session, std::move(backend), true)); | 512 new net::HttpCache(shared_session, std::move(backend), true)); |
512 } | 513 } |
OLD | NEW |