| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 std::unique_ptr<net::URLRequestJobFactory> | 395 std::unique_ptr<net::URLRequestJobFactory> |
| 396 ChromeBrowserStateIOData::SetUpJobFactoryDefaults( | 396 ChromeBrowserStateIOData::SetUpJobFactoryDefaults( |
| 397 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory, | 397 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory, |
| 398 URLRequestInterceptorScopedVector request_interceptors, | 398 URLRequestInterceptorScopedVector request_interceptors, |
| 399 net::NetworkDelegate* network_delegate) const { | 399 net::NetworkDelegate* network_delegate) const { |
| 400 // NOTE(willchan): Keep these protocol handlers in sync with | 400 // NOTE(willchan): Keep these protocol handlers in sync with |
| 401 // ChromeBrowserStateIOData::IsHandledProtocol(). | 401 // ChromeBrowserStateIOData::IsHandledProtocol(). |
| 402 bool set_protocol = job_factory->SetProtocolHandler( | 402 bool set_protocol = job_factory->SetProtocolHandler( |
| 403 url::kFileScheme, | 403 url::kFileScheme, |
| 404 base::WrapUnique(new net::FileProtocolHandler( | 404 base::MakeUnique<net::FileProtocolHandler>( |
| 405 web::WebThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( | 405 web::WebThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( |
| 406 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); | 406 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))); |
| 407 DCHECK(set_protocol); | 407 DCHECK(set_protocol); |
| 408 | 408 |
| 409 set_protocol = job_factory->SetProtocolHandler( | 409 set_protocol = job_factory->SetProtocolHandler( |
| 410 url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler())); | 410 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); |
| 411 DCHECK(set_protocol); | 411 DCHECK(set_protocol); |
| 412 | 412 |
| 413 job_factory->SetProtocolHandler( | 413 job_factory->SetProtocolHandler( |
| 414 url::kAboutScheme, | 414 url::kAboutScheme, |
| 415 base::WrapUnique(new about_handler::AboutProtocolHandler())); | 415 base::MakeUnique<about_handler::AboutProtocolHandler>()); |
| 416 | 416 |
| 417 // Set up interceptors in the reverse order. | 417 // Set up interceptors in the reverse order. |
| 418 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = | 418 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = |
| 419 std::move(job_factory); | 419 std::move(job_factory); |
| 420 for (URLRequestInterceptorScopedVector::reverse_iterator i = | 420 for (URLRequestInterceptorScopedVector::reverse_iterator i = |
| 421 request_interceptors.rbegin(); | 421 request_interceptors.rbegin(); |
| 422 i != request_interceptors.rend(); ++i) { | 422 i != request_interceptors.rend(); ++i) { |
| 423 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( | 423 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( |
| 424 std::move(top_job_factory), base::WrapUnique(*i))); | 424 std::move(top_job_factory), base::WrapUnique(*i))); |
| 425 } | 425 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 return std::unique_ptr<net::HttpCache>( | 484 return std::unique_ptr<net::HttpCache>( |
| 485 new net::HttpCache(session, std::move(main_backend), true)); | 485 new net::HttpCache(session, std::move(main_backend), true)); |
| 486 } | 486 } |
| 487 | 487 |
| 488 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 488 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
| 489 net::HttpNetworkSession* shared_session, | 489 net::HttpNetworkSession* shared_session, |
| 490 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 490 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
| 491 return std::unique_ptr<net::HttpCache>( | 491 return std::unique_ptr<net::HttpCache>( |
| 492 new net::HttpCache(shared_session, std::move(backend), true)); | 492 new net::HttpCache(shared_session, std::move(backend), true)); |
| 493 } | 493 } |
| OLD | NEW |