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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 893333002: Correctly clear deprecated "proxy" pref set by data reduction proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
index ce1f7c96096ffd7cfbd2c5fd8857c227b0b4cf9e..1297c623d29fc3aee810d8cd2f9a392bf8b5c1a8 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc
@@ -30,8 +30,17 @@ using data_reduction_proxy::DataReductionProxySettings;
// hierarchy. This method removes the Data Reduction Proxy configuration from
// prefs, if present. |proxy_pref_name| is the name of the proxy pref.
void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs) {
- DictionaryPrefUpdate update(prefs, prefs::kProxy);
- base::DictionaryValue* dict = update.Get();
+ base::DictionaryValue* dict =
+ (base::DictionaryValue*) prefs->GetUserPrefValue(prefs::kProxy);
+ if (!dict)
+ return;
+
+ // Clear empty "proxy" dictionary created by a bug. See http://crbug/448172
+ if (dict->empty()) {
+ prefs->ClearPref(prefs::kProxy);
+ return;
+ }
+
std::string mode;
if (!dict->GetString("mode", &mode))
return;
@@ -46,9 +55,7 @@ void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs) {
ContainsDataReductionProxy(proxy_rules)) {
return;
}
- dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_SYSTEM));
- dict->SetString("server", "");
- dict->SetString("bypass_list", "");
+ prefs->ClearPref(prefs::kProxy);
}
DataReductionProxyChromeSettings::DataReductionProxyChromeSettings(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698