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

Side by Side Diff: net/base/address_list.cc

Issue 2037933002: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | net/cert/x509_certificate_net_log_param.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/base/address_list.h" 5 #include "net/base/address_list.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "net/base/sys_addrinfo.h" 12 #include "net/base/sys_addrinfo.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 namespace { 16 namespace {
17 17
18 std::unique_ptr<base::Value> NetLogAddressListCallback( 18 std::unique_ptr<base::Value> NetLogAddressListCallback(
19 const AddressList* address_list, 19 const AddressList* address_list,
20 NetLogCaptureMode capture_mode) { 20 NetLogCaptureMode capture_mode) {
21 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 21 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
22 std::unique_ptr<base::ListValue> list(new base::ListValue()); 22 std::unique_ptr<base::ListValue> list(new base::ListValue());
23 23
24 for (AddressList::const_iterator it = address_list->begin(); 24 for (AddressList::const_iterator it = address_list->begin();
25 it != address_list->end(); ++it) { 25 it != address_list->end(); ++it) {
26 list->Append(new base::StringValue(it->ToString())); 26 list->AppendString(it->ToString());
27 } 27 }
28 28
29 dict->Set("address_list", std::move(list)); 29 dict->Set("address_list", std::move(list));
30 return std::move(dict); 30 return std::move(dict);
31 } 31 }
32 32
33 } // namespace 33 } // namespace
34 34
35 AddressList::AddressList() {} 35 AddressList::AddressList() {}
36 36
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void AddressList::SetDefaultCanonicalName() { 90 void AddressList::SetDefaultCanonicalName() {
91 DCHECK(!empty()); 91 DCHECK(!empty());
92 set_canonical_name(front().ToStringWithoutPort()); 92 set_canonical_name(front().ToStringWithoutPort());
93 } 93 }
94 94
95 NetLog::ParametersCallback AddressList::CreateNetLogCallback() const { 95 NetLog::ParametersCallback AddressList::CreateNetLogCallback() const {
96 return base::Bind(&NetLogAddressListCallback, this); 96 return base::Bind(&NetLogAddressListCallback, this);
97 } 97 }
98 98
99 } // namespace net 99 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/cert/x509_certificate_net_log_param.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698