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

Unified Diff: net/proxy/proxy_service.cc

Issue 1135373002: Updated NetLog::ParametersCallback & all related calbacks returning value as scoped_ptr<base::Value… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/proxy/proxy_script_decider.cc ('k') | net/quic/quic_client_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index d882aa30908ae04169283f758f94ec5b81a3c7ca..a3de0038caf09c4064dcd903900065fbb7a9cdf5 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -307,39 +307,40 @@ class ProxyResolverFactoryForPacResult : public ProxyResolverFactory {
};
// Returns NetLog parameters describing a proxy configuration change.
-base::Value* NetLogProxyConfigChangedCallback(
+scoped_ptr<base::Value> NetLogProxyConfigChangedCallback(
const ProxyConfig* old_config,
const ProxyConfig* new_config,
NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
// The "old_config" is optional -- the first notification will not have
// any "previous" configuration.
if (old_config->is_valid())
dict->Set("old_config", old_config->ToValue());
dict->Set("new_config", new_config->ToValue());
- return dict;
+ return dict.Pass();
}
-base::Value* NetLogBadProxyListCallback(const ProxyRetryInfoMap* retry_info,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
- base::ListValue* list = new base::ListValue();
+scoped_ptr<base::Value> NetLogBadProxyListCallback(
+ const ProxyRetryInfoMap* retry_info,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ scoped_ptr<base::ListValue> list(new base::ListValue());
for (ProxyRetryInfoMap::const_iterator iter = retry_info->begin();
iter != retry_info->end(); ++iter) {
list->Append(new base::StringValue(iter->first));
}
- dict->Set("bad_proxy_list", list);
- return dict;
+ dict->Set("bad_proxy_list", list.Pass());
+ return dict.Pass();
}
// Returns NetLog parameters on a successfuly proxy resolution.
-base::Value* NetLogFinishedResolvingProxyCallback(
+scoped_ptr<base::Value> NetLogFinishedResolvingProxyCallback(
const ProxyInfo* result,
NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("pac_string", result->ToPacString());
- return dict;
+ return dict.Pass();
}
#if defined(OS_CHROMEOS)
@@ -1343,7 +1344,7 @@ void ProxyService::ReportSuccess(const ProxyInfo& result,
if (net_log_) {
net_log_->AddGlobalEntry(
NetLog::TYPE_BAD_PROXY_LIST_REPORTED,
- base::Bind(&NetLogBadProxyListCallback, &new_retry_info));
+ base::Bind(NetLogBadProxyListCallback, &new_retry_info));
}
}
@@ -1414,7 +1415,7 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
if (net_log.IsCapturing()) {
net_log.AddEvent(
NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST,
- base::Bind(&NetLogFinishedResolvingProxyCallback, result));
+ base::Bind(NetLogFinishedResolvingProxyCallback, result));
}
result->DeprioritizeBadProxies(proxy_retry_info_);
} else {
@@ -1589,7 +1590,7 @@ void ProxyService::OnProxyConfigChanged(
// Emit the proxy settings change to the NetLog stream.
if (net_log_) {
net_log_->AddGlobalEntry(NetLog::TYPE_PROXY_CONFIG_CHANGED,
- base::Bind(&NetLogProxyConfigChangedCallback,
+ base::Bind(NetLogProxyConfigChangedCallback,
&fetched_config_, &effective_config));
}
« no previous file with comments | « net/proxy/proxy_script_decider.cc ('k') | net/quic/quic_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698