| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "net/http/http_cache.h" | 48 #include "net/http/http_cache.h" |
| 49 #include "net/http/http_server_properties_manager.h" | 49 #include "net/http/http_server_properties_manager.h" |
| 50 #include "net/ssl/channel_id_service.h" | 50 #include "net/ssl/channel_id_service.h" |
| 51 #include "net/url_request/url_request_job_factory_impl.h" | 51 #include "net/url_request/url_request_job_factory_impl.h" |
| 52 #include "webkit/browser/quota/special_storage_policy.h" | 52 #include "webkit/browser/quota/special_storage_policy.h" |
| 53 | 53 |
| 54 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 54 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
| 55 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 55 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 56 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" | 56 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" |
| 57 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" | 57 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" |
| 58 #include "components/data_reduction_proxy/browser/data_reduction_proxy_statistic
s_prefs.h" |
| 58 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" | 59 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" |
| 59 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" | 60 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names
.h" |
| 60 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 61 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
| 61 | 62 |
| 62 namespace { | 63 namespace { |
| 63 | 64 |
| 64 net::BackendType ChooseCacheBackendType() { | 65 net::BackendType ChooseCacheBackendType() { |
| 65 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
| 66 return net::CACHE_BACKEND_SIMPLE; | 67 return net::CACHE_BACKEND_SIMPLE; |
| 67 #else | 68 #else |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 const base::FilePath& infinite_cache_path, | 135 const base::FilePath& infinite_cache_path, |
| 135 chrome_browser_net::Predictor* predictor, | 136 chrome_browser_net::Predictor* predictor, |
| 136 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, | 137 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, |
| 137 storage::SpecialStoragePolicy* special_storage_policy, | 138 storage::SpecialStoragePolicy* special_storage_policy, |
| 138 scoped_ptr<domain_reliability::DomainReliabilityMonitor> | 139 scoped_ptr<domain_reliability::DomainReliabilityMonitor> |
| 139 domain_reliability_monitor, | 140 domain_reliability_monitor, |
| 140 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, | 141 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, |
| 141 scoped_ptr<DataReductionProxyChromeConfigurator> | 142 scoped_ptr<DataReductionProxyChromeConfigurator> |
| 142 data_reduction_proxy_chrome_configurator, | 143 data_reduction_proxy_chrome_configurator, |
| 143 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 144 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
| 144 data_reduction_proxy_params) { | 145 data_reduction_proxy_params, |
| 146 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
| 147 data_reduction_proxy_statistics_prefs) { |
| 145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 146 DCHECK(!io_data_->lazy_params_); | 149 DCHECK(!io_data_->lazy_params_); |
| 147 DCHECK(predictor); | 150 DCHECK(predictor); |
| 148 | 151 |
| 149 LazyParams* lazy_params = new LazyParams(); | 152 LazyParams* lazy_params = new LazyParams(); |
| 150 | 153 |
| 151 lazy_params->cookie_path = cookie_path; | 154 lazy_params->cookie_path = cookie_path; |
| 152 lazy_params->channel_id_path = channel_id_path; | 155 lazy_params->channel_id_path = channel_id_path; |
| 153 lazy_params->cache_path = cache_path; | 156 lazy_params->cache_path = cache_path; |
| 154 lazy_params->cache_max_size = cache_max_size; | 157 lazy_params->cache_max_size = cache_max_size; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 174 if (io_data_->domain_reliability_monitor_) | 177 if (io_data_->domain_reliability_monitor_) |
| 175 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); | 178 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); |
| 176 | 179 |
| 177 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 180 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
| 178 io_data_->data_reduction_proxy_unavailable_callback_ = | 181 io_data_->data_reduction_proxy_unavailable_callback_ = |
| 179 data_reduction_proxy_unavailable; | 182 data_reduction_proxy_unavailable; |
| 180 io_data_->data_reduction_proxy_chrome_configurator_ = | 183 io_data_->data_reduction_proxy_chrome_configurator_ = |
| 181 data_reduction_proxy_chrome_configurator.Pass(); | 184 data_reduction_proxy_chrome_configurator.Pass(); |
| 182 io_data_->data_reduction_proxy_params_ = | 185 io_data_->data_reduction_proxy_params_ = |
| 183 data_reduction_proxy_params.Pass(); | 186 data_reduction_proxy_params.Pass(); |
| 187 io_data_->data_reduction_proxy_statistics_prefs_ = |
| 188 data_reduction_proxy_statistics_prefs.Pass(); |
| 184 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 189 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
| 185 } | 190 } |
| 186 | 191 |
| 187 content::ResourceContext* | 192 content::ResourceContext* |
| 188 ProfileImplIOData::Handle::GetResourceContext() const { | 193 ProfileImplIOData::Handle::GetResourceContext() const { |
| 189 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 190 LazyInitialize(); | 195 LazyInitialize(); |
| 191 return GetResourceContextNoInit(); | 196 return GetResourceContextNoInit(); |
| 192 } | 197 } |
| 193 | 198 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 data_reduction_proxy_usage_stats_->set_unavailable_callback( | 448 data_reduction_proxy_usage_stats_->set_unavailable_callback( |
| 444 data_reduction_proxy_unavailable_callback_); | 449 data_reduction_proxy_unavailable_callback_); |
| 445 | 450 |
| 446 | 451 |
| 447 network_delegate()->set_data_reduction_proxy_params( | 452 network_delegate()->set_data_reduction_proxy_params( |
| 448 data_reduction_proxy_params_.get()); | 453 data_reduction_proxy_params_.get()); |
| 449 network_delegate()->set_data_reduction_proxy_usage_stats( | 454 network_delegate()->set_data_reduction_proxy_usage_stats( |
| 450 data_reduction_proxy_usage_stats_.get()); | 455 data_reduction_proxy_usage_stats_.get()); |
| 451 network_delegate()->set_data_reduction_proxy_auth_request_handler( | 456 network_delegate()->set_data_reduction_proxy_auth_request_handler( |
| 452 data_reduction_proxy_auth_request_handler_.get()); | 457 data_reduction_proxy_auth_request_handler_.get()); |
| 458 network_delegate()->set_data_reduction_proxy_statistics_prefs( |
| 459 data_reduction_proxy_statistics_prefs_.get()); |
| 453 network_delegate()->set_on_resolve_proxy_handler( | 460 network_delegate()->set_on_resolve_proxy_handler( |
| 454 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | 461 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); |
| 455 network_delegate()->set_proxy_config_getter( | 462 network_delegate()->set_proxy_config_getter( |
| 456 base::Bind( | 463 base::Bind( |
| 457 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIO, | 464 &DataReductionProxyChromeConfigurator::GetProxyConfigOnIO, |
| 458 base::Unretained(data_reduction_proxy_chrome_configurator_.get()))); | 465 base::Unretained(data_reduction_proxy_chrome_configurator_.get()))); |
| 459 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 466 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
| 460 | 467 |
| 461 network_delegate()->set_predictor(predictor_.get()); | 468 network_delegate()->set_predictor(predictor_.get()); |
| 462 | 469 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 const base::Closure& completion) { | 842 const base::Closure& completion) { |
| 836 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 843 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 837 DCHECK(initialized()); | 844 DCHECK(initialized()); |
| 838 | 845 |
| 839 DCHECK(transport_security_state()); | 846 DCHECK(transport_security_state()); |
| 840 // Completes synchronously. | 847 // Completes synchronously. |
| 841 transport_security_state()->DeleteAllDynamicDataSince(time); | 848 transport_security_state()->DeleteAllDynamicDataSince(time); |
| 842 DCHECK(http_server_properties_manager_); | 849 DCHECK(http_server_properties_manager_); |
| 843 http_server_properties_manager_->Clear(completion); | 850 http_server_properties_manager_->Clear(completion); |
| 844 } | 851 } |
| OLD | NEW |