| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); | 409 url::kDataScheme, base::MakeUnique<net::DataProtocolHandler>()); |
| 410 DCHECK(set_protocol); | 410 DCHECK(set_protocol); |
| 411 | 411 |
| 412 job_factory->SetProtocolHandler( | 412 job_factory->SetProtocolHandler( |
| 413 url::kAboutScheme, | 413 url::kAboutScheme, |
| 414 base::MakeUnique<about_handler::AboutProtocolHandler>()); | 414 base::MakeUnique<about_handler::AboutProtocolHandler>()); |
| 415 | 415 |
| 416 // Set up interceptors in the reverse order. | 416 // Set up interceptors in the reverse order. |
| 417 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = | 417 std::unique_ptr<net::URLRequestJobFactory> top_job_factory = |
| 418 std::move(job_factory); | 418 std::move(job_factory); |
| 419 for (URLRequestInterceptorScopedVector::reverse_iterator i = | 419 for (auto i = request_interceptors.rbegin(); i != request_interceptors.rend(); |
| 420 request_interceptors.rbegin(); | 420 ++i) { |
| 421 i != request_interceptors.rend(); ++i) { | |
| 422 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( | 421 top_job_factory.reset(new net::URLRequestInterceptingJobFactory( |
| 423 std::move(top_job_factory), base::WrapUnique(*i))); | 422 std::move(top_job_factory), std::move(*i))); |
| 424 } | 423 } |
| 425 request_interceptors.weak_clear(); | 424 request_interceptors.clear(); |
| 426 return top_job_factory; | 425 return top_job_factory; |
| 427 } | 426 } |
| 428 | 427 |
| 429 void ChromeBrowserStateIOData::ShutdownOnUIThread( | 428 void ChromeBrowserStateIOData::ShutdownOnUIThread( |
| 430 std::unique_ptr<IOSChromeURLRequestContextGetterVector> context_getters) { | 429 std::unique_ptr<IOSChromeURLRequestContextGetterVector> context_getters) { |
| 431 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 430 DCHECK_CURRENTLY_ON(web::WebThread::UI); |
| 432 | 431 |
| 433 google_services_user_account_id_.Destroy(); | 432 google_services_user_account_id_.Destroy(); |
| 434 enable_referrers_.Destroy(); | 433 enable_referrers_.Destroy(); |
| 435 enable_do_not_track_.Destroy(); | 434 enable_do_not_track_.Destroy(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 return std::unique_ptr<net::HttpCache>( | 482 return std::unique_ptr<net::HttpCache>( |
| 484 new net::HttpCache(session, std::move(main_backend), true)); | 483 new net::HttpCache(session, std::move(main_backend), true)); |
| 485 } | 484 } |
| 486 | 485 |
| 487 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( | 486 std::unique_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory( |
| 488 net::HttpNetworkSession* shared_session, | 487 net::HttpNetworkSession* shared_session, |
| 489 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { | 488 std::unique_ptr<net::HttpCache::BackendFactory> backend) const { |
| 490 return std::unique_ptr<net::HttpCache>( | 489 return std::unique_ptr<net::HttpCache>( |
| 491 new net::HttpCache(shared_session, std::move(backend), true)); | 490 new net::HttpCache(shared_session, std::move(backend), true)); |
| 492 } | 491 } |
| OLD | NEW |