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

Unified Diff: net/proxy/proxy_config.cc

Issue 1149763005: Change NetLog::ParametersCallback to return a scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments on ownership removed Created 5 years, 7 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 | « net/log/net_log_util.cc ('k') | net/proxy/proxy_resolver_v8_tracing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config.cc
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index 71264fd0b67f8c3f77c43c7dcbf35f2f1a3296d7..a88ed63cd05a093b6e983efd712809350f20e3d1 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -232,7 +232,7 @@ void ProxyConfig::ClearAutomaticSettings() {
}
base::DictionaryValue* ProxyConfig::ToValue() const {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
// Output the automatic settings.
if (auto_detect_)
@@ -247,16 +247,18 @@ base::DictionaryValue* ProxyConfig::ToValue() const {
if (proxy_rules_.type != ProxyRules::TYPE_NO_RULES) {
switch (proxy_rules_.type) {
case ProxyRules::TYPE_SINGLE_PROXY:
- AddProxyListToValue("single_proxy",
- proxy_rules_.single_proxies, dict);
+ AddProxyListToValue("single_proxy", proxy_rules_.single_proxies,
+ dict.get());
break;
case ProxyRules::TYPE_PROXY_PER_SCHEME: {
- base::DictionaryValue* dict2 = new base::DictionaryValue();
- AddProxyListToValue("http", proxy_rules_.proxies_for_http, dict2);
- AddProxyListToValue("https", proxy_rules_.proxies_for_https, dict2);
- AddProxyListToValue("ftp", proxy_rules_.proxies_for_ftp, dict2);
- AddProxyListToValue("fallback", proxy_rules_.fallback_proxies, dict2);
- dict->Set("proxy_per_scheme", dict2);
+ scoped_ptr<base::DictionaryValue> dict2(new base::DictionaryValue());
+ AddProxyListToValue("http", proxy_rules_.proxies_for_http, dict2.get());
+ AddProxyListToValue("https", proxy_rules_.proxies_for_https,
+ dict2.get());
+ AddProxyListToValue("ftp", proxy_rules_.proxies_for_ftp, dict2.get());
+ AddProxyListToValue("fallback", proxy_rules_.fallback_proxies,
+ dict2.get());
+ dict->Set("proxy_per_scheme", dict2.Pass());
break;
}
default:
@@ -284,7 +286,7 @@ base::DictionaryValue* ProxyConfig::ToValue() const {
// Output the source.
dict->SetString("source", ProxyConfigSourceToString(source_));
- return dict;
+ return dict.release();
}
} // namespace net
« no previous file with comments | « net/log/net_log_util.cc ('k') | net/proxy/proxy_resolver_v8_tracing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698