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

Side by Side Diff: net/cert/x509_certificate_net_log_param.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 | « net/base/address_list.cc ('k') | net/dns/dns_config_service.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/cert/x509_certificate_net_log_param.h" 5 #include "net/cert/x509_certificate_net_log_param.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "net/cert/x509_certificate.h" 13 #include "net/cert/x509_certificate.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 std::unique_ptr<base::Value> NetLogX509CertificateCallback( 17 std::unique_ptr<base::Value> NetLogX509CertificateCallback(
18 const X509Certificate* certificate, 18 const X509Certificate* certificate,
19 NetLogCaptureMode capture_mode) { 19 NetLogCaptureMode capture_mode) {
20 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 20 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
21 std::unique_ptr<base::ListValue> certs(new base::ListValue()); 21 std::unique_ptr<base::ListValue> certs(new base::ListValue());
22 std::vector<std::string> encoded_chain; 22 std::vector<std::string> encoded_chain;
23 certificate->GetPEMEncodedChain(&encoded_chain); 23 certificate->GetPEMEncodedChain(&encoded_chain);
24 for (size_t i = 0; i < encoded_chain.size(); ++i) 24 for (size_t i = 0; i < encoded_chain.size(); ++i)
25 certs->Append(new base::StringValue(encoded_chain[i])); 25 certs->AppendString(encoded_chain[i]);
26 dict->Set("certificates", std::move(certs)); 26 dict->Set("certificates", std::move(certs));
27 return std::move(dict); 27 return std::move(dict);
28 } 28 }
29 29
30 } // namespace net 30 } // namespace net
OLDNEW
« no previous file with comments | « net/base/address_list.cc ('k') | net/dns/dns_config_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698