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

Unified Diff: net/socket/socket_net_log_params.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/socket/nss_ssl_util.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_net_log_params.cc
diff --git a/net/socket/socket_net_log_params.cc b/net/socket/socket_net_log_params.cc
index 3dd6595525d60cb7efc45d6264d83be78655a4b1..64012f4264ce6bfa824e92cad1ee8007851a56af 100644
--- a/net/socket/socket_net_log_params.cc
+++ b/net/socket/socket_net_log_params.cc
@@ -14,36 +14,40 @@ namespace net {
namespace {
-base::Value* NetLogSocketErrorCallback(int net_error,
- int os_error,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+scoped_ptr<base::Value> NetLogSocketErrorCallback(
+ int net_error,
+ int os_error,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetInteger("net_error", net_error);
dict->SetInteger("os_error", os_error);
- return dict;
+ return dict.Pass();
}
-base::Value* NetLogHostPortPairCallback(const HostPortPair* host_and_port,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+scoped_ptr<base::Value> NetLogHostPortPairCallback(
+ const HostPortPair* host_and_port,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("host_and_port", host_and_port->ToString());
- return dict;
+ return dict.Pass();
}
-base::Value* NetLogIPEndPointCallback(const IPEndPoint* address,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+scoped_ptr<base::Value> NetLogIPEndPointCallback(
+ const IPEndPoint* address,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("address", address->ToString());
- return dict;
+ return dict.Pass();
}
-base::Value* NetLogSourceAddressCallback(const struct sockaddr* net_address,
- socklen_t address_len,
- NetLogCaptureMode /* capture_mode */) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+scoped_ptr<base::Value> NetLogSourceAddressCallback(
+ const struct sockaddr* net_address,
+ socklen_t address_len,
+ NetLogCaptureMode /* capture_mode */) {
+ scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("source_address",
NetAddressToStringWithPort(net_address, address_len));
- return dict;
+ return dict.Pass();
}
} // namespace
« no previous file with comments | « net/socket/nss_ssl_util.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698