Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/profiles/profile_impl_io_data.h" | 5 #include "chrome/browser/profiles/profile_impl_io_data.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 #include "net/ftp/ftp_network_layer.h" | 61 #include "net/ftp/ftp_network_layer.h" |
| 62 #include "net/http/http_cache.h" | 62 #include "net/http/http_cache.h" |
| 63 #include "net/http/http_network_session.h" | 63 #include "net/http/http_network_session.h" |
| 64 #include "net/http/http_server_properties_manager.h" | 64 #include "net/http/http_server_properties_manager.h" |
| 65 #include "net/sdch/sdch_owner.h" | 65 #include "net/sdch/sdch_owner.h" |
| 66 #include "net/ssl/channel_id_service.h" | 66 #include "net/ssl/channel_id_service.h" |
| 67 #include "net/url_request/url_request_intercepting_job_factory.h" | 67 #include "net/url_request/url_request_intercepting_job_factory.h" |
| 68 #include "net/url_request/url_request_job_factory_impl.h" | 68 #include "net/url_request/url_request_job_factory_impl.h" |
| 69 #include "storage/browser/quota/special_storage_policy.h" | 69 #include "storage/browser/quota/special_storage_policy.h" |
| 70 | 70 |
| 71 #if defined(OS_ANDROID) | |
| 72 #include "chrome/browser/android/offline_pages/offline_page_request_handler.h" | |
| 73 #endif // defined(OS_ANDROID) | |
| 74 | |
| 71 namespace { | 75 namespace { |
| 72 | 76 |
| 73 net::BackendType ChooseCacheBackendType() { | 77 net::BackendType ChooseCacheBackendType() { |
| 74 #if !defined(OS_ANDROID) | 78 #if !defined(OS_ANDROID) |
| 75 const base::CommandLine& command_line = | 79 const base::CommandLine& command_line = |
| 76 *base::CommandLine::ForCurrentProcess(); | 80 *base::CommandLine::ForCurrentProcess(); |
| 77 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { | 81 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { |
| 78 const std::string opt_value = | 82 const std::string opt_value = |
| 79 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); | 83 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); |
| 80 if (base::LowerCaseEqualsASCII(opt_value, "off")) | 84 if (base::LowerCaseEqualsASCII(opt_value, "off")) |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 | 525 |
| 522 #if !defined(DISABLE_FTP_SUPPORT) | 526 #if !defined(DISABLE_FTP_SUPPORT) |
| 523 ftp_factory_.reset( | 527 ftp_factory_.reset( |
| 524 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 528 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 525 #endif // !defined(DISABLE_FTP_SUPPORT) | 529 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 526 | 530 |
| 527 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 531 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 528 new net::URLRequestJobFactoryImpl()); | 532 new net::URLRequestJobFactoryImpl()); |
| 529 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 533 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 530 | 534 |
| 535 // Install the Offline Page Interceptor. | |
| 536 #if defined(OS_ANDROID) | |
| 537 std::unique_ptr<net::URLRequestInterceptor> offline_page_interceptor = | |
| 538 offline_pages::OfflinePageRequestHandler::CreateInterceptor( | |
| 539 profile_params->profile); | |
| 540 if (offline_page_interceptor.get()) | |
| 541 request_interceptors.push_back(offline_page_interceptor.release()); | |
|
mmenke
2016/08/10 21:42:36
Think you can use std::move(offline_page_intercept
| |
| 542 #endif | |
| 543 | |
| 531 // The data reduction proxy interceptor should be as close to the network | 544 // The data reduction proxy interceptor should be as close to the network |
| 532 // as possible. | 545 // as possible. |
| 533 request_interceptors.insert( | 546 request_interceptors.insert( |
| 534 request_interceptors.begin(), | 547 request_interceptors.begin(), |
| 535 data_reduction_proxy_io_data()->CreateInterceptor().release()); | 548 data_reduction_proxy_io_data()->CreateInterceptor().release()); |
| 536 main_job_factory_ = SetUpJobFactoryDefaults( | 549 main_job_factory_ = SetUpJobFactoryDefaults( |
| 537 std::move(main_job_factory), std::move(request_interceptors), | 550 std::move(main_job_factory), std::move(request_interceptors), |
| 538 std::move(profile_params->protocol_handler_interceptor), | 551 std::move(profile_params->protocol_handler_interceptor), |
| 539 main_context->network_delegate(), ftp_factory_.get()); | 552 main_context->network_delegate(), ftp_factory_.get()); |
| 540 main_context->set_job_factory(main_job_factory_.get()); | 553 main_context->set_job_factory(main_job_factory_.get()); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 785 const base::Closure& completion) { | 798 const base::Closure& completion) { |
| 786 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 799 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 787 DCHECK(initialized()); | 800 DCHECK(initialized()); |
| 788 | 801 |
| 789 DCHECK(transport_security_state()); | 802 DCHECK(transport_security_state()); |
| 790 // Completes synchronously. | 803 // Completes synchronously. |
| 791 transport_security_state()->DeleteAllDynamicDataSince(time); | 804 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 792 DCHECK(http_server_properties_manager_); | 805 DCHECK(http_server_properties_manager_); |
| 793 http_server_properties_manager_->Clear(completion); | 806 http_server_properties_manager_->Clear(completion); |
| 794 } | 807 } |
| OLD | NEW |