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

Unified Diff: chrome/browser/extensions/extension_proxy_api.cc

Issue 5441002: Clean up pref change notification handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leaks in tests. Created 10 years 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/extensions/extension_proxy_api.cc
diff --git a/chrome/browser/extensions/extension_proxy_api.cc b/chrome/browser/extensions/extension_proxy_api.cc
index 030b711fbdad7405ee399bf09128b488036152b4..a9d0bbd0fdf7315da6772d3df4aa46683897fcaa 100644
--- a/chrome/browser/extensions/extension_proxy_api.cc
+++ b/chrome/browser/extensions/extension_proxy_api.cc
@@ -79,8 +79,8 @@ bool UseCustomProxySettingsFunction::ApplyAutoDetect(bool auto_detect) {
// We take control of the auto-detect preference even if none was specified,
// so that all proxy preferences are controlled by the same extension (if not
// by a higher-priority source).
- SendNotification(prefs::kProxyAutoDetect,
- Value::CreateBooleanValue(auto_detect));
+ scoped_ptr<Value> value(Value::CreateBooleanValue(auto_detect));
+ SendNotification(prefs::kProxyAutoDetect, value.get());
return true;
}
@@ -92,7 +92,8 @@ bool UseCustomProxySettingsFunction::ApplyPacScript(DictionaryValue* pac_dict) {
// We take control of the PAC preference even if none was specified, so that
// all proxy preferences are controlled by the same extension (if not by a
// higher-priority source).
- SendNotification(prefs::kProxyPacUrl, Value::CreateStringValue(pac_url));
+ scoped_ptr<Value> value(Value::CreateStringValue(pac_url));
+ SendNotification(prefs::kProxyPacUrl, value.get());
return true;
}
@@ -153,7 +154,8 @@ bool UseCustomProxySettingsFunction::ApplyProxyRules(
}
}
- SendNotification(prefs::kProxyServer, Value::CreateStringValue(proxy_pref));
+ scoped_ptr<Value> value(Value::CreateStringValue(proxy_pref));
+ SendNotification(prefs::kProxyServer, value.get());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698