| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 200 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
| 201 std::unique_ptr<data_reduction_proxy::DataStore> store( | 201 std::unique_ptr<data_reduction_proxy::DataStore> store( |
| 202 new data_reduction_proxy::DataStoreImpl(profile_path)); | 202 new data_reduction_proxy::DataStoreImpl(profile_path)); |
| 203 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_) | 203 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_) |
| 204 ->InitDataReductionProxySettings( | 204 ->InitDataReductionProxySettings( |
| 205 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(), | 205 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(), |
| 206 profile_->GetRequestContext(), std::move(store), | 206 profile_->GetRequestContext(), std::move(store), |
| 207 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), | 207 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), |
| 208 db_task_runner); | 208 db_task_runner); |
| 209 | 209 |
| 210 io_data_->set_previews_io_data(base::MakeUnique<previews::PreviewsIOData>( | 210 io_data_->previews_io_data_ = base::MakeUnique<previews::PreviewsIOData>( |
| 211 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), | 211 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), |
| 212 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); | 212 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 213 PreviewsServiceFactory::GetForProfile(profile_)->set_previews_ui_service( | 213 PreviewsServiceFactory::GetForProfile(profile_)->set_previews_ui_service( |
| 214 base::MakeUnique<previews::PreviewsUIService>( | 214 base::MakeUnique<previews::PreviewsUIService>( |
| 215 io_data_->previews_io_data(), | 215 io_data_->previews_io_data_.get(), |
| 216 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), nullptr)); | 216 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), nullptr)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 content::ResourceContext* | 219 content::ResourceContext* |
| 220 ProfileImplIOData::Handle::GetResourceContext() const { | 220 ProfileImplIOData::Handle::GetResourceContext() const { |
| 221 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 221 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 222 LazyInitialize(); | 222 LazyInitialize(); |
| 223 return GetResourceContextNoInit(); | 223 return GetResourceContextNoInit(); |
| 224 } | 224 } |
| 225 | 225 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); | 542 new net::FtpNetworkLayer(io_thread_globals->host_resolver.get())); |
| 543 #endif // !defined(DISABLE_FTP_SUPPORT) | 543 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 544 | 544 |
| 545 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( | 545 std::unique_ptr<net::URLRequestJobFactoryImpl> main_job_factory( |
| 546 new net::URLRequestJobFactoryImpl()); | 546 new net::URLRequestJobFactoryImpl()); |
| 547 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); | 547 InstallProtocolHandlers(main_job_factory.get(), protocol_handlers); |
| 548 | 548 |
| 549 // Install the Offline Page Interceptor. | 549 // Install the Offline Page Interceptor. |
| 550 #if defined(OS_ANDROID) | 550 #if defined(OS_ANDROID) |
| 551 request_interceptors.push_back(std::unique_ptr<net::URLRequestInterceptor>( | 551 request_interceptors.push_back(std::unique_ptr<net::URLRequestInterceptor>( |
| 552 new offline_pages::OfflinePageRequestInterceptor())); | 552 new offline_pages::OfflinePageRequestInterceptor( |
| 553 previews_io_data_.get()))); |
| 553 #endif | 554 #endif |
| 554 | 555 |
| 555 // The data reduction proxy interceptor should be as close to the network | 556 // The data reduction proxy interceptor should be as close to the network |
| 556 // as possible. | 557 // as possible. |
| 557 request_interceptors.insert( | 558 request_interceptors.insert( |
| 558 request_interceptors.begin(), | 559 request_interceptors.begin(), |
| 559 data_reduction_proxy_io_data()->CreateInterceptor().release()); | 560 data_reduction_proxy_io_data()->CreateInterceptor().release()); |
| 560 main_job_factory_ = SetUpJobFactoryDefaults( | 561 main_job_factory_ = SetUpJobFactoryDefaults( |
| 561 std::move(main_job_factory), std::move(request_interceptors), | 562 std::move(main_job_factory), std::move(request_interceptors), |
| 562 std::move(profile_params->protocol_handler_interceptor), | 563 std::move(profile_params->protocol_handler_interceptor), |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 const base::Closure& completion) { | 808 const base::Closure& completion) { |
| 808 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 809 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 809 DCHECK(initialized()); | 810 DCHECK(initialized()); |
| 810 | 811 |
| 811 DCHECK(transport_security_state()); | 812 DCHECK(transport_security_state()); |
| 812 // Completes synchronously. | 813 // Completes synchronously. |
| 813 transport_security_state()->DeleteAllDynamicDataSince(time); | 814 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 814 DCHECK(http_server_properties_manager_); | 815 DCHECK(http_server_properties_manager_); |
| 815 http_server_properties_manager_->Clear(completion); | 816 http_server_properties_manager_->Clear(completion); |
| 816 } | 817 } |
| OLD | NEW |