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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc

Issue 665703002: Activate data reduction proxy after profile initialization is complete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 years, 2 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
index 955a58162d0978884b1d60f73981bcd3ad188341..16940b8a937b96cf43f9d132e5ede36d66c10b89 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
@@ -137,9 +137,6 @@ void DataReductionProxySettings::InitDataReductionProxySettings(
AddDefaultProxyBypassRules();
net::NetworkChangeNotifier::AddIPAddressObserver(this);
-
- // We set or reset the proxy pref at startup.
- MaybeActivateDataReductionProxy(true);
}
void DataReductionProxySettings::InitDataReductionProxySettings(
@@ -382,6 +379,11 @@ void DataReductionProxySettings::MaybeActivateDataReductionProxy(
bool at_startup) {
DCHECK(thread_checker_.CalledOnValidThread());
PrefService* prefs = GetOriginalProfilePrefs();
+ // Do nothing if prefs have not been initialized. This allows unit testing
+ // of profile related code without having to initialize data reduction proxy
+ // related prefs.
+ if (!prefs)
+ return;
// TODO(marq): Consider moving this so stats are wiped the first time the
// proxy settings are actually (not maybe) turned on.
if (spdy_proxy_auth_enabled_.GetValue() &&

Powered by Google App Engine
This is Rietveld 408576698