| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 46 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 47 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
| 48 #include "components/data_reduction_proxy/core/browser/data_store_impl.h" | 48 #include "components/data_reduction_proxy/core/browser/data_store_impl.h" |
| 49 #include "components/domain_reliability/monitor.h" | 49 #include "components/domain_reliability/monitor.h" |
| 50 #include "components/net_log/chrome_net_log.h" | 50 #include "components/net_log/chrome_net_log.h" |
| 51 #include "components/prefs/json_pref_store.h" | 51 #include "components/prefs/json_pref_store.h" |
| 52 #include "components/prefs/pref_filter.h" | 52 #include "components/prefs/pref_filter.h" |
| 53 #include "components/prefs/pref_member.h" | 53 #include "components/prefs/pref_member.h" |
| 54 #include "components/prefs/pref_service.h" | 54 #include "components/prefs/pref_service.h" |
| 55 #include "components/previews/core/previews_io_data.h" | 55 #include "components/previews/core/previews_io_data.h" |
| 56 #include "components/reporting/content/browser/reporting_network_delegate.h" |
| 56 #include "content/public/browser/browser_thread.h" | 57 #include "content/public/browser/browser_thread.h" |
| 57 #include "content/public/browser/cookie_store_factory.h" | 58 #include "content/public/browser/cookie_store_factory.h" |
| 58 #include "content/public/browser/notification_service.h" | 59 #include "content/public/browser/notification_service.h" |
| 59 #include "content/public/browser/resource_context.h" | 60 #include "content/public/browser/resource_context.h" |
| 60 #include "content/public/browser/storage_partition.h" | 61 #include "content/public/browser/storage_partition.h" |
| 61 #include "extensions/browser/extension_protocols.h" | 62 #include "extensions/browser/extension_protocols.h" |
| 62 #include "extensions/common/constants.h" | 63 #include "extensions/common/constants.h" |
| 63 #include "net/base/cache_type.h" | 64 #include "net/base/cache_type.h" |
| 64 #include "net/base/sdch_manager.h" | 65 #include "net/base/sdch_manager.h" |
| 65 #include "net/cookies/cookie_store.h" | 66 #include "net/cookies/cookie_store.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 const base::FilePath& cache_path, | 149 const base::FilePath& cache_path, |
| 149 int cache_max_size, | 150 int cache_max_size, |
| 150 const base::FilePath& media_cache_path, | 151 const base::FilePath& media_cache_path, |
| 151 int media_cache_max_size, | 152 int media_cache_max_size, |
| 152 const base::FilePath& extensions_cookie_path, | 153 const base::FilePath& extensions_cookie_path, |
| 153 const base::FilePath& profile_path, | 154 const base::FilePath& profile_path, |
| 154 chrome_browser_net::Predictor* predictor, | 155 chrome_browser_net::Predictor* predictor, |
| 155 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, | 156 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, |
| 156 storage::SpecialStoragePolicy* special_storage_policy, | 157 storage::SpecialStoragePolicy* special_storage_policy, |
| 157 std::unique_ptr<domain_reliability::DomainReliabilityMonitor> | 158 std::unique_ptr<domain_reliability::DomainReliabilityMonitor> |
| 158 domain_reliability_monitor) { | 159 domain_reliability_monitor, |
| 160 std::unique_ptr<reporting::ReportingNetworkDelegate::Handle> |
| 161 reporting_handle) { |
| 159 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 162 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 160 DCHECK(!io_data_->lazy_params_); | 163 DCHECK(!io_data_->lazy_params_); |
| 161 DCHECK(predictor); | 164 DCHECK(predictor); |
| 162 | 165 |
| 163 LazyParams* lazy_params = new LazyParams(); | 166 LazyParams* lazy_params = new LazyParams(); |
| 164 | 167 |
| 165 lazy_params->cookie_path = cookie_path; | 168 lazy_params->cookie_path = cookie_path; |
| 166 lazy_params->channel_id_path = channel_id_path; | 169 lazy_params->channel_id_path = channel_id_path; |
| 167 lazy_params->cache_path = cache_path; | 170 lazy_params->cache_path = cache_path; |
| 168 lazy_params->cache_max_size = cache_max_size; | 171 lazy_params->cache_max_size = cache_max_size; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 182 io_data_->lazy_params_.reset(lazy_params); | 185 io_data_->lazy_params_.reset(lazy_params); |
| 183 | 186 |
| 184 // Keep track of profile path and cache sizes separately so we can use them | 187 // Keep track of profile path and cache sizes separately so we can use them |
| 185 // on demand when creating storage isolated URLRequestContextGetters. | 188 // on demand when creating storage isolated URLRequestContextGetters. |
| 186 io_data_->profile_path_ = profile_path; | 189 io_data_->profile_path_ = profile_path; |
| 187 io_data_->app_cache_max_size_ = cache_max_size; | 190 io_data_->app_cache_max_size_ = cache_max_size; |
| 188 io_data_->app_media_cache_max_size_ = media_cache_max_size; | 191 io_data_->app_media_cache_max_size_ = media_cache_max_size; |
| 189 | 192 |
| 190 io_data_->predictor_.reset(predictor); | 193 io_data_->predictor_.reset(predictor); |
| 191 io_data_->domain_reliability_monitor_ = std::move(domain_reliability_monitor); | 194 io_data_->domain_reliability_monitor_ = std::move(domain_reliability_monitor); |
| 195 io_data_->reporting_handle_ = std::move(reporting_handle); |
| 192 | 196 |
| 193 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 197 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
| 194 if (io_data_->domain_reliability_monitor_) | 198 if (io_data_->domain_reliability_monitor_) |
| 195 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); | 199 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
| 196 | 200 |
| 197 io_data_->set_data_reduction_proxy_io_data( | 201 io_data_->set_data_reduction_proxy_io_data( |
| 198 CreateDataReductionProxyChromeIOData( | 202 CreateDataReductionProxyChromeIOData( |
| 199 g_browser_process->io_thread()->net_log(), profile_->GetPrefs(), | 203 g_browser_process->io_thread()->net_log(), profile_->GetPrefs(), |
| 200 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | 204 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
| 201 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); | 205 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI))); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 main_context_storage->set_http_server_properties( | 479 main_context_storage->set_http_server_properties( |
| 476 std::move(lazy_params_->http_server_properties_manager)); | 480 std::move(lazy_params_->http_server_properties_manager)); |
| 477 } | 481 } |
| 478 | 482 |
| 479 main_context->set_transport_security_state(transport_security_state()); | 483 main_context->set_transport_security_state(transport_security_state()); |
| 480 main_context->set_ct_policy_enforcer( | 484 main_context->set_ct_policy_enforcer( |
| 481 io_thread_globals->ct_policy_enforcer.get()); | 485 io_thread_globals->ct_policy_enforcer.get()); |
| 482 | 486 |
| 483 main_context->set_net_log(io_thread->net_log()); | 487 main_context->set_net_log(io_thread->net_log()); |
| 484 | 488 |
| 485 main_context_storage->set_network_delegate( | 489 { |
| 486 data_reduction_proxy_io_data()->CreateNetworkDelegate( | 490 std::unique_ptr<net::NetworkDelegate> network_delegate = |
| 487 io_thread_globals->data_use_ascriber->CreateNetworkDelegate( | 491 std::move(chrome_network_delegate); |
| 488 std::move(chrome_network_delegate)), | 492 |
| 489 true)); | 493 network_delegate = data_reduction_proxy_io_data()->CreateNetworkDelegate( |
| 494 io_thread_globals->data_use_ascriber->CreateNetworkDelegate( |
| 495 std::move(network_delegate)), |
| 496 true); |
| 497 |
| 498 if (reporting_handle_) { |
| 499 network_delegate = base::MakeUnique<reporting::ReportingNetworkDelegate>( |
| 500 std::move(network_delegate), std::move(reporting_handle_)); |
| 501 } |
| 502 |
| 503 main_context->set_network_delegate(network_delegate.release()); |
| 504 } |
| 490 | 505 |
| 491 main_context->set_host_resolver( | 506 main_context->set_host_resolver( |
| 492 io_thread_globals->host_resolver.get()); | 507 io_thread_globals->host_resolver.get()); |
| 493 | 508 |
| 494 main_context->set_http_auth_handler_factory( | 509 main_context->set_http_auth_handler_factory( |
| 495 io_thread_globals->http_auth_handler_factory.get()); | 510 io_thread_globals->http_auth_handler_factory.get()); |
| 496 | 511 |
| 497 main_context->set_proxy_service(proxy_service()); | 512 main_context->set_proxy_service(proxy_service()); |
| 498 | 513 |
| 499 // Set up cookie store. | 514 // Set up cookie store. |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 const base::Closure& completion) { | 823 const base::Closure& completion) { |
| 809 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 824 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 810 DCHECK(initialized()); | 825 DCHECK(initialized()); |
| 811 | 826 |
| 812 DCHECK(transport_security_state()); | 827 DCHECK(transport_security_state()); |
| 813 // Completes synchronously. | 828 // Completes synchronously. |
| 814 transport_security_state()->DeleteAllDynamicDataSince(time); | 829 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 815 DCHECK(http_server_properties_manager_); | 830 DCHECK(http_server_properties_manager_); |
| 816 http_server_properties_manager_->Clear(completion); | 831 http_server_properties_manager_->Clear(completion); |
| 817 } | 832 } |
| OLD | NEW |