Chromium Code Reviews| 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)); |
|
bengr
2015/02/04 00:09:50
Should we also clear the pref if we encounter this
Not at Google. Contact bengr
2015/02/04 00:44:14
Safer not to, especially if we are patching this t
|
| - dict->SetString("server", ""); |
| - dict->SetString("bypass_list", ""); |
| + prefs->ClearPref(prefs::kProxy); |
| } |
| DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( |