| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/values.h" | 7 #include "base/values.h" |
| 8 #include "net/base/x509_certificate.h" | 8 #include "net/base/x509_certificate.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 X509CertificateNetLogParam::X509CertificateNetLogParam( | 12 X509CertificateNetLogParam::X509CertificateNetLogParam( |
| 13 X509Certificate* certificate) { | 13 X509Certificate* certificate) { |
| 14 certificate->GetPEMEncodedChain(&encoded_chain_); | 14 certificate->GetPEMEncodedChain(&encoded_chain_); |
| 15 } | 15 } |
| 16 | 16 |
| 17 X509CertificateNetLogParam::~X509CertificateNetLogParam() {} | |
| 18 | |
| 19 base::Value* X509CertificateNetLogParam::ToValue() const { | 17 base::Value* X509CertificateNetLogParam::ToValue() const { |
| 20 DictionaryValue* dict = new DictionaryValue(); | 18 DictionaryValue* dict = new DictionaryValue(); |
| 21 ListValue* certs = new ListValue(); | 19 ListValue* certs = new ListValue(); |
| 22 for (size_t i = 0; i < encoded_chain_.size(); ++i) | 20 for (size_t i = 0; i < encoded_chain_.size(); ++i) |
| 23 certs->Append(base::Value::CreateStringValue(encoded_chain_[i])); | 21 certs->Append(base::Value::CreateStringValue(encoded_chain_[i])); |
| 24 dict->Set("certificates", certs); | 22 dict->Set("certificates", certs); |
| 25 return dict; | 23 return dict; |
| 26 } | 24 } |
| 27 | 25 |
| 26 X509CertificateNetLogParam::~X509CertificateNetLogParam() {} |
| 27 |
| 28 } // namespace net | 28 } // namespace net |
| OLD | NEW |