Commit 253dde8e authored by kundaji's avatar kundaji Committed by Commit bot

Correctly clear deprecated "proxy" pref set by data reduction proxy.

Clear empty "proxy" dictionary created by bug in data reduction proxy code.

BUG=448172

Review URL: https://codereview.chromium.org/893333002

Cr-Commit-Position: refs/heads/master@{#314593}
parent 59ca1ee5
...@@ -30,8 +30,17 @@ using data_reduction_proxy::DataReductionProxySettings; ...@@ -30,8 +30,17 @@ using data_reduction_proxy::DataReductionProxySettings;
// hierarchy. This method removes the Data Reduction Proxy configuration from // hierarchy. This method removes the Data Reduction Proxy configuration from
// prefs, if present. |proxy_pref_name| is the name of the proxy pref. // prefs, if present. |proxy_pref_name| is the name of the proxy pref.
void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs) { void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs) {
DictionaryPrefUpdate update(prefs, prefs::kProxy); base::DictionaryValue* dict =
base::DictionaryValue* dict = update.Get(); (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; std::string mode;
if (!dict->GetString("mode", &mode)) if (!dict->GetString("mode", &mode))
return; return;
...@@ -46,9 +55,7 @@ void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs) { ...@@ -46,9 +55,7 @@ void MigrateDataReductionProxyOffProxyPrefs(PrefService* prefs) {
ContainsDataReductionProxy(proxy_rules)) { ContainsDataReductionProxy(proxy_rules)) {
return; return;
} }
dict->SetString("mode", ProxyModeToString(ProxyPrefs::MODE_SYSTEM)); prefs->ClearPref(prefs::kProxy);
dict->SetString("server", "");
dict->SetString("bypass_list", "");
} }
DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( DataReductionProxyChromeSettings::DataReductionProxyChromeSettings(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment