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

Unified Diff: net/dns/dns_transaction.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/dns/dns_config_service.cc ('k') | net/dns/host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_transaction.cc
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 014709220af4715e0fd89823c251ed191c0c0801..d0357f89dff1223188843c3a75d9e4a46d88806a 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -58,13 +58,14 @@ bool IsIPLiteral(const std::string& hostname) {
return ParseIPLiteralToNumber(hostname, &ip);
}
-base::Value* NetLogStartCallback(const std::string* hostname,
- uint16 qtype,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+scoped_ptr<base::Value> NetLogStartCallback(
+ const std::string* hostname,
+ uint16 qtype,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("hostname", *hostname);
dict->SetInteger("query_type", qtype);
- return dict;
+ return dict.Pass();
};
// ----------------------------------------------------------------------------
@@ -98,14 +99,15 @@ class DnsAttempt {
// Returns a Value representing the received response, along with a reference
// to the NetLog source source of the UDP socket used. The request must have
// completed before this is called.
- base::Value* NetLogResponseCallback(NetLogCaptureMode capture_mode) const {
+ scoped_ptr<base::Value> NetLogResponseCallback(
+ NetLogCaptureMode capture_mode) const {
DCHECK(GetResponse()->IsValid());
- base::DictionaryValue* dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger("rcode", GetResponse()->rcode());
dict->SetInteger("answer_count", GetResponse()->answer_count());
- GetSocketNetLog().source().AddToEventParameters(dict);
- return dict;
+ GetSocketNetLog().source().AddToEventParameters(dict.get());
+ return dict.Pass();
}
void set_result(int result) {
@@ -592,7 +594,7 @@ class DnsTransactionImpl : public DnsTransaction,
DCHECK(!callback_.is_null());
DCHECK(attempts_.empty());
net_log_.BeginEvent(NetLog::TYPE_DNS_TRANSACTION,
- base::Bind(&NetLogStartCallback, &hostname_, qtype_));
+ base::Bind(NetLogStartCallback, &hostname_, qtype_));
AttemptResult result(PrepareSearch(), NULL);
if (result.rv == OK) {
qnames_initial_size_ = qnames_.size();
« no previous file with comments | « net/dns/dns_config_service.cc ('k') | net/dns/host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698