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

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

Issue 10539094: NetLogEventParameter to Callback refactoring 1, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unneeded line Created 8 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 | Annotate | Revision Log
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/x509_certificate_net_log_param.h" 5 #include "net/base/x509_certificate_net_log_param.h"
6 6
7 #include <string>
8 #include <vector>
9
7 #include "base/values.h" 10 #include "base/values.h"
8 #include "net/base/x509_certificate.h" 11 #include "net/base/x509_certificate.h"
9 12
10 namespace net { 13 namespace net {
11 14
12 X509CertificateNetLogParam::X509CertificateNetLogParam( 15 base::Value* NetLogX509CertificateCallback(const X509Certificate* certificate,
13 X509Certificate* certificate) { 16 NetLog::LogLevel log_level) {
14 certificate->GetPEMEncodedChain(&encoded_chain_);
15 }
16
17 base::Value* X509CertificateNetLogParam::ToValue() const {
18 DictionaryValue* dict = new DictionaryValue(); 17 DictionaryValue* dict = new DictionaryValue();
19 ListValue* certs = new ListValue(); 18 ListValue* certs = new ListValue();
20 for (size_t i = 0; i < encoded_chain_.size(); ++i) 19 std::vector<std::string> encoded_chain;
21 certs->Append(base::Value::CreateStringValue(encoded_chain_[i])); 20 certificate->GetPEMEncodedChain(&encoded_chain);
21 for (size_t i = 0; i < encoded_chain.size(); ++i)
22 certs->Append(base::Value::CreateStringValue(encoded_chain[i]));
22 dict->Set("certificates", certs); 23 dict->Set("certificates", certs);
23 return dict; 24 return dict;
24 } 25 }
25 26
26 X509CertificateNetLogParam::~X509CertificateNetLogParam() {}
27
28 } // namespace net 27 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698