| 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 CreateHttpNetworkSession(*profile_params)); | 543 CreateHttpNetworkSession(*profile_params)); |
| 544 main_context_storage->set_http_transaction_factory(CreateMainHttpFactory( | 544 main_context_storage->set_http_transaction_factory(CreateMainHttpFactory( |
| 545 main_context_storage->http_network_session(), std::move(main_backend))); | 545 main_context_storage->http_network_session(), std::move(main_backend))); |
| 546 | 546 |
| 547 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 547 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 548 new net::URLRequestJobFactoryImpl()); | 548 new net::URLRequestJobFactoryImpl()); |
| 549 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 549 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 550 | 550 |
| 551 // Install the Offline Page Interceptor. | 551 // Install the Offline Page Interceptor. |
| 552 #if defined(OS_ANDROID) | 552 #if defined(OS_ANDROID) |
| 553 request_interceptors.push_back(std::unique_ptr<net::URLRequestInterceptor>( | 553 request_interceptors.push_back( |
| 554 new offline_pages::OfflinePageRequestInterceptor( | 554 base::MakeUnique<offline_pages::OfflinePageRequestInterceptor>( |
| 555 previews_io_data_.get()))); | 555 previews_io_data_.get())); |
| 556 #endif | 556 #endif |
| 557 | 557 |
| 558 // The data reduction proxy interceptor should be as close to the network | 558 // The data reduction proxy interceptor should be as close to the network |
| 559 // as possible. | 559 // as possible. |
| 560 request_interceptors.insert( | 560 request_interceptors.insert( |
| 561 request_interceptors.begin(), | 561 request_interceptors.begin(), |
| 562 data_reduction_proxy_io_data()->CreateInterceptor().release()); | 562 data_reduction_proxy_io_data()->CreateInterceptor()); |
| 563 main_context_storage->set_job_factory(SetUpJobFactoryDefaults( | 563 main_context_storage->set_job_factory(SetUpJobFactoryDefaults( |
| 564 std::move(main_job_factory), std::move(request_interceptors), | 564 std::move(main_job_factory), std::move(request_interceptors), |
| 565 std::move(profile_params->protocol_handler_interceptor), | 565 std::move(profile_params->protocol_handler_interceptor), |
| 566 main_context->network_delegate(), | 566 main_context->network_delegate(), |
| 567 io_thread_globals->host_resolver.get())); | 567 io_thread_globals->host_resolver.get())); |
| 568 main_context->set_network_quality_estimator( | 568 main_context->set_network_quality_estimator( |
| 569 io_thread_globals->network_quality_estimator.get()); | 569 io_thread_globals->network_quality_estimator.get()); |
| 570 | 570 |
| 571 #if BUILDFLAG(ENABLE_EXTENSIONS) | 571 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 572 InitializeExtensionsRequestContext(profile_params); | 572 InitializeExtensionsRequestContext(profile_params); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 context->SetCookieStore(std::move(cookie_store)); | 706 context->SetCookieStore(std::move(cookie_store)); |
| 707 context->SetHttpTransactionFactory(std::move(app_http_cache)); | 707 context->SetHttpTransactionFactory(std::move(app_http_cache)); |
| 708 | 708 |
| 709 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( | 709 std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory( |
| 710 new net::URLRequestJobFactoryImpl()); | 710 new net::URLRequestJobFactoryImpl()); |
| 711 InstallProtocolHandlers(job_factory.get(), protocol_handlers); | 711 InstallProtocolHandlers(job_factory.get(), protocol_handlers); |
| 712 // The data reduction proxy interceptor should be as close to the network | 712 // The data reduction proxy interceptor should be as close to the network |
| 713 // as possible. | 713 // as possible. |
| 714 request_interceptors.insert( | 714 request_interceptors.insert( |
| 715 request_interceptors.begin(), | 715 request_interceptors.begin(), |
| 716 data_reduction_proxy_io_data()->CreateInterceptor().release()); | 716 data_reduction_proxy_io_data()->CreateInterceptor()); |
| 717 | 717 |
| 718 std::unique_ptr<net::URLRequestJobFactory> top_job_factory( | 718 std::unique_ptr<net::URLRequestJobFactory> top_job_factory( |
| 719 SetUpJobFactoryDefaults( | 719 SetUpJobFactoryDefaults( |
| 720 std::move(job_factory), std::move(request_interceptors), | 720 std::move(job_factory), std::move(request_interceptors), |
| 721 std::move(protocol_handler_interceptor), context->network_delegate(), | 721 std::move(protocol_handler_interceptor), context->network_delegate(), |
| 722 context->host_resolver())); | 722 context->host_resolver())); |
| 723 context->SetJobFactory(std::move(top_job_factory)); | 723 context->SetJobFactory(std::move(top_job_factory)); |
| 724 | 724 |
| 725 return context; | 725 return context; |
| 726 } | 726 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 const base::Closure& completion) { | 815 const base::Closure& completion) { |
| 816 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 816 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 817 DCHECK(initialized()); | 817 DCHECK(initialized()); |
| 818 | 818 |
| 819 DCHECK(transport_security_state()); | 819 DCHECK(transport_security_state()); |
| 820 // Completes synchronously. | 820 // Completes synchronously. |
| 821 transport_security_state()->DeleteAllDynamicDataSince(time); | 821 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 822 DCHECK(http_server_properties_manager_); | 822 DCHECK(http_server_properties_manager_); |
| 823 http_server_properties_manager_->Clear(completion); | 823 http_server_properties_manager_->Clear(completion); |
| 824 } | 824 } |
| OLD | NEW |