| 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
|
|
|