Chromium Code Reviews| Index: chrome/browser/profiles/profile_impl.cc |
| diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
| index fbaf8bbe9644604aae4fb426af6874fb42b844d8..216f5663fbaaa1e7bd7e3f7d55f54e19897980c5 100644 |
| --- a/chrome/browser/profiles/profile_impl.cc |
| +++ b/chrome/browser/profiles/profile_impl.cc |
| @@ -46,6 +46,7 @@ |
| #include "chrome/browser/net/predictor.h" |
| #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| #include "chrome/browser/net/proxy_service_factory.h" |
| +#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| #include "chrome/browser/net/ssl_config_service_manager.h" |
| #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| #include "chrome/browser/plugins/plugin_prefs.h" |
| @@ -111,6 +112,13 @@ |
| #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| #endif |
| +#if defined(SPDY_PROXY_AUTH_ORIGIN) |
| +#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h" |
| +#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h" |
| +#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
| +#include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.h" |
| +#endif |
| + |
| #if defined(ENABLE_CONFIGURATION_POLICY) |
| #include "chrome/browser/policy/schema_registry_service.h" |
| #include "chrome/browser/policy/schema_registry_service_factory.h" |
| @@ -607,6 +615,14 @@ void ProfileImpl::DoFinalInit() { |
| InitHostZoomMap(); |
| + base::Callback<void(bool)> data_reduction_proxy_unavailable; |
| + scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
| + data_reduction_proxy_params; |
| +#if defined(SPDY_PROXY_AUTH_ORIGIN) |
| + InitDataReductionProxyForIO(&data_reduction_proxy_params, |
| + &data_reduction_proxy_unavailable); |
|
willchan no longer on Chromium
2014/07/31 22:31:35
indentation off
bengr
2014/08/02 01:10:31
Done.
|
| +#endif |
| + |
| // Make sure we initialize the ProfileIOData after everything else has been |
| // initialized that we might be reading from the IO thread. |
| @@ -614,7 +630,13 @@ void ProfileImpl::DoFinalInit() { |
| cache_max_size, media_cache_path, media_cache_max_size, |
| extensions_cookie_path, GetPath(), infinite_cache_path, |
| predictor_, session_cookie_mode, GetSpecialStoragePolicy(), |
| - CreateDomainReliabilityMonitor()); |
| + CreateDomainReliabilityMonitor(), |
| + data_reduction_proxy_unavailable, |
| + data_reduction_proxy_params.Pass()); |
| + |
| +#if defined(SPDY_PROXY_AUTH_ORIGIN) |
| + InitDataReductionProxySettings(); |
| +#endif |
| #if defined(ENABLE_PLUGINS) |
| ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
| @@ -716,6 +738,31 @@ void ProfileImpl::InitHostZoomMap() { |
| base::Bind(&ProfileImpl::OnZoomLevelChanged, base::Unretained(this))); |
| } |
| +#if defined(SPDY_PROXY_AUTH_ORIGIN) |
| +void ProfileImpl::InitDataReductionProxyForIO( |
|
willchan no longer on Chromium
2014/07/31 22:31:34
There's no reason for this to be a member function
marq (ping after 24h)
2014/07/31 23:54:32
Nit: This doesn't actually initialize the data red
bengr
2014/08/02 01:10:31
Done.
bengr
2014/08/02 01:10:31
Done.
|
| + scoped_ptr<data_reduction_proxy::DataReductionProxyParams>* params, |
| + base::Callback<void(bool)>* unavailable_callback) { |
| + DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
| + DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
| + DCHECK(params); |
| + params->reset(data_reduction_proxy_chrome_settings->params()->Clone()); |
|
marq (ping after 24h)
2014/07/31 23:54:32
Params is cloned so there's a copy for the IO thre
bengr
2014/08/02 01:10:31
The issue is lifetime. The profile's IO data outli
|
| + *unavailable_callback = |
| + base::Bind( |
| + &data_reduction_proxy::DataReductionProxySettings::SetUnreachable, |
| + base::Unretained(data_reduction_proxy_chrome_settings)); |
| +} |
| + |
| +void ProfileImpl::InitDataReductionProxySettings() { |
|
willchan no longer on Chromium
2014/07/31 22:31:34
Ditto, this doesn't need to be a member function.
bengr
2014/08/02 01:10:32
Done.
|
| + scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator> |
| + configurator(new DataReductionProxyChromeConfigurator(prefs_.get())); |
| + DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this)-> |
|
marq (ping after 24h)
2014/07/31 23:54:32
Right, so this will use the params created in Data
bengr
2014/08/02 01:10:31
The global params are for the system context.
|
| + InitDataReductionProxySettings(configurator.Pass(), |
| + prefs_.get(), |
| + g_browser_process->local_state(), |
| + GetRequestContext()); |
| +} |
| +#endif // defined(SPDY_PROXY_AUTH_ORIGIN) |
| + |
| base::FilePath ProfileImpl::last_selected_directory() { |
| return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); |
| } |