Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3870)

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Fixed tests Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index bd6fa639f1b53acd868d2e6f67858967bb050fc0..b7256e0f165116de6b9e076592f0b510c5fad967 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -632,6 +632,7 @@ void ProfileImpl::DoFinalInit() {
base::Callback<void(bool)> data_reduction_proxy_unavailable;
scoped_ptr<data_reduction_proxy::DataReductionProxyParams>
data_reduction_proxy_params;
+ base::Callback<const net::ProxyConfig&()> proxy_config_getter;
#if defined(SPDY_PROXY_AUTH_ORIGIN)
DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings =
DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this);
@@ -641,6 +642,15 @@ void ProfileImpl::DoFinalInit() {
base::Bind(
&data_reduction_proxy::DataReductionProxySettings::SetUnreachable,
base::Unretained(data_reduction_proxy_chrome_settings));
+ DataReductionProxyChromeConfigurator* chrome_configurator =
+ new DataReductionProxyChromeConfigurator(
+ prefs_.get(),
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
+ scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
+ configurator(chrome_configurator);
+ proxy_config_getter = base::Bind(
+ &DataReductionProxyChromeConfigurator::GetProxyConfigOnIO,
+ base::Unretained(chrome_configurator));
#endif
// Make sure we initialize the ProfileIOData after everything else has been
@@ -652,11 +662,10 @@ void ProfileImpl::DoFinalInit() {
predictor_, session_cookie_mode, GetSpecialStoragePolicy(),
CreateDomainReliabilityMonitor(),
data_reduction_proxy_unavailable,
+ proxy_config_getter,
data_reduction_proxy_params.Pass());
mmenke 2014/08/12 20:15:53 How is this safe? Looks like the chrome_configura
bengr 2014/08/13 01:31:28 Done.
#if defined(SPDY_PROXY_AUTH_ORIGIN)
- scoped_ptr<data_reduction_proxy::DataReductionProxyConfigurator>
- configurator(new DataReductionProxyChromeConfigurator(prefs_.get()));
data_reduction_proxy_chrome_settings->InitDataReductionProxySettings(
configurator.Pass(),
prefs_.get(),

Powered by Google App Engine
This is Rietveld 408576698