Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc

Issue 1892123003: Add components/network_session_configurator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: #22. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 448 }
449 449
450 void ChromeBrowserStateIOData::set_channel_id_service( 450 void ChromeBrowserStateIOData::set_channel_id_service(
451 net::ChannelIDService* channel_id_service) const { 451 net::ChannelIDService* channel_id_service) const {
452 channel_id_service_.reset(channel_id_service); 452 channel_id_service_.reset(channel_id_service);
453 } 453 }
454 454
455 std::unique_ptr<net::HttpNetworkSession> 455 std::unique_ptr<net::HttpNetworkSession>
456 ChromeBrowserStateIOData::CreateHttpNetworkSession( 456 ChromeBrowserStateIOData::CreateHttpNetworkSession(
457 const ProfileParams& profile_params) const { 457 const ProfileParams& profile_params) const {
458 net::HttpNetworkSession::Params params;
459 net::URLRequestContext* context = main_request_context(); 458 net::URLRequestContext* context = main_request_context();
460 459
461 IOSChromeIOThread* const io_thread = profile_params.io_thread; 460 IOSChromeIOThread* const io_thread = profile_params.io_thread;
462 461
463 io_thread->InitializeNetworkSessionParams(&params); 462 net::HttpNetworkSession::Params params(io_thread->NetworkSessionParams());
464 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, 463 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context,
465 &params); 464 &params);
466 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) { 465 if (!IsOffTheRecord() && io_thread->globals()->network_quality_estimator) {
467 params.socket_performance_watcher_factory = 466 params.socket_performance_watcher_factory =
468 io_thread->globals() 467 io_thread->globals()
469 ->network_quality_estimator->GetSocketPerformanceWatcherFactory(); 468 ->network_quality_estimator->GetSocketPerformanceWatcherFactory();
470 } 469 }
471 470
472 return std::unique_ptr<net::HttpNetworkSession>( 471 return std::unique_ptr<net::HttpNetworkSession>(
473 new net::HttpNetworkSession(params)); 472 new net::HttpNetworkSession(params));
474 } 473 }
475 474
476 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory( 475 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory(
477 net::HttpNetworkSession* session, 476 net::HttpNetworkSession* session,
478 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const { 477 std::unique_ptr<net::HttpCache::BackendFactory> main_backend) const {
479 return std::unique_ptr<net::HttpCache>( 478 return std::unique_ptr<net::HttpCache>(
480 new net::HttpCache(session, std::move(main_backend), true)); 479 new net::HttpCache(session, std::move(main_backend), true));
481 } 480 }
482 481
483 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( 482 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory(
484 net::HttpNetworkSession* shared_session, 483 net::HttpNetworkSession* shared_session,
485 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { 484 std::unique_ptr<net::HttpCache::BackendFactory> backend) const {
486 return std::unique_ptr<net::HttpCache>( 485 return std::unique_ptr<net::HttpCache>(
487 new net::HttpCache(shared_session, std::move(backend), true)); 486 new net::HttpCache(shared_session, std::move(backend), true));
488 } 487 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698