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

Unified Diff: net/quic/quic_client_session.cc

Issue 1149243003: Returning scoped_ptr instead of raw pointer in QuicInfoToValue in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated review comments. 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/quic/quic_client_session.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_client_session.cc
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index c86e76a7079df94bd0a46f392b15d6b6a526919b..5f825db395a1ec27598379faa8926063bb91aaa7 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -830,12 +830,12 @@ void QuicClientSession::CloseAllObservers(int net_error) {
}
}
-base::Value* QuicClientSession::GetInfoAsValue(
+scoped_ptr<base::Value> QuicClientSession::GetInfoAsValue(
const std::set<HostPortPair>& aliases) {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("version", QuicVersionToString(connection()->version()));
dict->SetInteger("open_streams", GetNumOpenStreams());
- base::ListValue* stream_list = new base::ListValue();
+ scoped_ptr<base::ListValue> stream_list(new base::ListValue());
for (base::hash_map<QuicStreamId, QuicDataStream*>::const_iterator it
= streams()->begin();
it != streams()->end();
@@ -843,7 +843,7 @@ base::Value* QuicClientSession::GetInfoAsValue(
stream_list->Append(new base::StringValue(
base::Uint64ToString(it->second->id())));
}
- dict->Set("active_streams", stream_list);
+ dict->Set("active_streams", stream_list.Pass());
dict->SetInteger("total_streams", num_total_streams_);
dict->SetString("peer_address", peer_address().ToString());
@@ -856,14 +856,14 @@ base::Value* QuicClientSession::GetInfoAsValue(
SSLInfo ssl_info;
dict->SetBoolean("secure", GetSSLInfo(&ssl_info) && ssl_info.cert.get());
- base::ListValue* alias_list = new base::ListValue();
+ scoped_ptr<base::ListValue> alias_list(new base::ListValue());
for (std::set<HostPortPair>::const_iterator it = aliases.begin();
it != aliases.end(); it++) {
alias_list->Append(new base::StringValue(it->ToString()));
}
- dict->Set("aliases", alias_list);
+ dict->Set("aliases", alias_list.Pass());
- return dict.release();
+ return dict.Pass();
}
base::WeakPtr<QuicClientSession> QuicClientSession::GetWeakPtr() {
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698