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

Side by Side Diff: net/udp/udp_net_log_parameters.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « net/tools/testserver/run_testserver.cc ('k') | net/udp/udp_socket_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/udp/udp_net_log_parameters.h" 5 #include "net/udp/udp_net_log_parameters.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "net/base/ip_endpoint.h" 12 #include "net/base/ip_endpoint.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 namespace { 16 namespace {
17 17
18 scoped_ptr<base::Value> NetLogUDPDataTranferCallback( 18 std::unique_ptr<base::Value> NetLogUDPDataTranferCallback(
19 int byte_count, 19 int byte_count,
20 const char* bytes, 20 const char* bytes,
21 const IPEndPoint* address, 21 const IPEndPoint* address,
22 NetLogCaptureMode capture_mode) { 22 NetLogCaptureMode capture_mode) {
23 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 23 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
24 dict->SetInteger("byte_count", byte_count); 24 dict->SetInteger("byte_count", byte_count);
25 if (capture_mode.include_socket_bytes()) 25 if (capture_mode.include_socket_bytes())
26 dict->SetString("hex_encoded_bytes", base::HexEncode(bytes, byte_count)); 26 dict->SetString("hex_encoded_bytes", base::HexEncode(bytes, byte_count));
27 if (address) 27 if (address)
28 dict->SetString("address", address->ToString()); 28 dict->SetString("address", address->ToString());
29 return std::move(dict); 29 return std::move(dict);
30 } 30 }
31 31
32 scoped_ptr<base::Value> NetLogUDPConnectCallback( 32 std::unique_ptr<base::Value> NetLogUDPConnectCallback(
33 const IPEndPoint* address, 33 const IPEndPoint* address,
34 NetLogCaptureMode /* capture_mode */) { 34 NetLogCaptureMode /* capture_mode */) {
35 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 35 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
36 dict->SetString("address", address->ToString()); 36 dict->SetString("address", address->ToString());
37 return std::move(dict); 37 return std::move(dict);
38 } 38 }
39 39
40 } // namespace 40 } // namespace
41 41
42 NetLog::ParametersCallback CreateNetLogUDPDataTranferCallback( 42 NetLog::ParametersCallback CreateNetLogUDPDataTranferCallback(
43 int byte_count, 43 int byte_count,
44 const char* bytes, 44 const char* bytes,
45 const IPEndPoint* address) { 45 const IPEndPoint* address) {
46 DCHECK(bytes); 46 DCHECK(bytes);
47 return base::Bind(&NetLogUDPDataTranferCallback, byte_count, bytes, address); 47 return base::Bind(&NetLogUDPDataTranferCallback, byte_count, bytes, address);
48 } 48 }
49 49
50 NetLog::ParametersCallback CreateNetLogUDPConnectCallback( 50 NetLog::ParametersCallback CreateNetLogUDPConnectCallback(
51 const IPEndPoint* address) { 51 const IPEndPoint* address) {
52 DCHECK(address); 52 DCHECK(address);
53 return base::Bind(&NetLogUDPConnectCallback, address); 53 return base::Bind(&NetLogUDPConnectCallback, address);
54 } 54 }
55 55
56 } // namespace net 56 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/testserver/run_testserver.cc ('k') | net/udp/udp_socket_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698