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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 int media_cache_max_size, | 146 int media_cache_max_size, |
147 const base::FilePath& extensions_cookie_path, | 147 const base::FilePath& extensions_cookie_path, |
148 const base::FilePath& profile_path, | 148 const base::FilePath& profile_path, |
149 const base::FilePath& infinite_cache_path, | 149 const base::FilePath& infinite_cache_path, |
150 chrome_browser_net::Predictor* predictor, | 150 chrome_browser_net::Predictor* predictor, |
151 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, | 151 content::CookieStoreConfig::SessionCookieMode session_cookie_mode, |
152 quota::SpecialStoragePolicy* special_storage_policy, | 152 quota::SpecialStoragePolicy* special_storage_policy, |
153 scoped_ptr<domain_reliability::DomainReliabilityMonitor> | 153 scoped_ptr<domain_reliability::DomainReliabilityMonitor> |
154 domain_reliability_monitor, | 154 domain_reliability_monitor, |
155 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, | 155 const base::Callback<void(bool)>& data_reduction_proxy_unavailable, |
| 156 const base::Callback<void(net::ProxyConfig*)>& proxy_config_getter, |
156 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 157 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
157 data_reduction_proxy_params) { | 158 data_reduction_proxy_params) { |
158 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 159 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
159 DCHECK(!io_data_->lazy_params_); | 160 DCHECK(!io_data_->lazy_params_); |
160 DCHECK(predictor); | 161 DCHECK(predictor); |
161 | 162 |
162 LazyParams* lazy_params = new LazyParams(); | 163 LazyParams* lazy_params = new LazyParams(); |
163 | 164 |
164 lazy_params->cookie_path = cookie_path; | 165 lazy_params->cookie_path = cookie_path; |
165 lazy_params->channel_id_path = channel_id_path; | 166 lazy_params->channel_id_path = channel_id_path; |
(...skipping 15 matching lines...) Expand all Loading... |
181 io_data_->app_media_cache_max_size_ = media_cache_max_size; | 182 io_data_->app_media_cache_max_size_ = media_cache_max_size; |
182 | 183 |
183 io_data_->predictor_.reset(predictor); | 184 io_data_->predictor_.reset(predictor); |
184 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); | 185 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); |
185 | 186 |
186 io_data_->InitializeMetricsEnabledStateOnUIThread(); | 187 io_data_->InitializeMetricsEnabledStateOnUIThread(); |
187 | 188 |
188 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 189 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
189 io_data_->data_reduction_proxy_unavailable_callback_ = | 190 io_data_->data_reduction_proxy_unavailable_callback_ = |
190 data_reduction_proxy_unavailable; | 191 data_reduction_proxy_unavailable; |
| 192 io_data_->proxy_config_getter_ = proxy_config_getter; |
191 io_data_->data_reduction_proxy_params_ = | 193 io_data_->data_reduction_proxy_params_ = |
192 data_reduction_proxy_params.Pass(); | 194 data_reduction_proxy_params.Pass(); |
193 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 195 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
194 } | 196 } |
195 | 197 |
196 content::ResourceContext* | 198 content::ResourceContext* |
197 ProfileImplIOData::Handle::GetResourceContext() const { | 199 ProfileImplIOData::Handle::GetResourceContext() const { |
198 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 200 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
199 LazyInitialize(); | 201 LazyInitialize(); |
200 return GetResourceContextNoInit(); | 202 return GetResourceContextNoInit(); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 430 |
429 | 431 |
430 network_delegate()->set_data_reduction_proxy_params( | 432 network_delegate()->set_data_reduction_proxy_params( |
431 data_reduction_proxy_params_.get()); | 433 data_reduction_proxy_params_.get()); |
432 network_delegate()->set_data_reduction_proxy_usage_stats( | 434 network_delegate()->set_data_reduction_proxy_usage_stats( |
433 data_reduction_proxy_usage_stats_.get()); | 435 data_reduction_proxy_usage_stats_.get()); |
434 network_delegate()->set_data_reduction_proxy_auth_request_handler( | 436 network_delegate()->set_data_reduction_proxy_auth_request_handler( |
435 data_reduction_proxy_auth_request_handler_.get()); | 437 data_reduction_proxy_auth_request_handler_.get()); |
436 network_delegate()->set_on_resolve_proxy_handler( | 438 network_delegate()->set_on_resolve_proxy_handler( |
437 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); | 439 base::Bind(data_reduction_proxy::OnResolveProxyHandler)); |
| 440 network_delegate()->set_proxy_config_getter(proxy_config_getter_); |
438 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) | 441 #endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
439 | 442 |
440 network_delegate()->set_predictor(predictor_.get()); | 443 network_delegate()->set_predictor(predictor_.get()); |
441 | 444 |
442 // Initialize context members. | 445 // Initialize context members. |
443 | 446 |
444 ApplyProfileParamsToContext(main_context); | 447 ApplyProfileParamsToContext(main_context); |
445 | 448 |
446 if (http_server_properties_manager_) | 449 if (http_server_properties_manager_) |
447 http_server_properties_manager_->InitializeOnNetworkThread(); | 450 http_server_properties_manager_->InitializeOnNetworkThread(); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 const base::Closure& completion) { | 820 const base::Closure& completion) { |
818 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 821 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
819 DCHECK(initialized()); | 822 DCHECK(initialized()); |
820 | 823 |
821 DCHECK(transport_security_state()); | 824 DCHECK(transport_security_state()); |
822 // Completes synchronously. | 825 // Completes synchronously. |
823 transport_security_state()->DeleteAllDynamicDataSince(time); | 826 transport_security_state()->DeleteAllDynamicDataSince(time); |
824 DCHECK(http_server_properties_manager_); | 827 DCHECK(http_server_properties_manager_); |
825 http_server_properties_manager_->Clear(completion); | 828 http_server_properties_manager_->Clear(completion); |
826 } | 829 } |
OLD | NEW |