Chromium Code Reviews| OLD | NEW |
|---|---|
| 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* NetLogX509CertificateNetLogCallback( |
| 13 X509Certificate* certificate) { | 16 scoped_refptr<const X509Certificate> certificate, |
|
eroman
2012/06/11 23:42:25
nit: per previous comment, might want to just pass
mmenke
2012/06/12 00:42:19
Done.
| |
| 14 certificate->GetPEMEncodedChain(&encoded_chain_); | 17 NetLog::LogLevel log_level) { |
| 15 } | 18 if (!NetLog::IsLoggingBytes(log_level)) |
|
eroman
2012/06/11 23:42:25
Are you sure about this? I thought we were always
mmenke
2012/06/12 00:42:19
I actually removed it locally after noticing the c
| |
| 16 | 19 return NULL; |
| 17 base::Value* X509CertificateNetLogParam::ToValue() const { | |
| 18 DictionaryValue* dict = new DictionaryValue(); | 20 DictionaryValue* dict = new DictionaryValue(); |
| 19 ListValue* certs = new ListValue(); | 21 ListValue* certs = new ListValue(); |
| 20 for (size_t i = 0; i < encoded_chain_.size(); ++i) | 22 std::vector<std::string> encoded_chain; |
| 21 certs->Append(base::Value::CreateStringValue(encoded_chain_[i])); | 23 certificate->GetPEMEncodedChain(&encoded_chain); |
| 24 for (size_t i = 0; i < encoded_chain.size(); ++i) | |
| 25 certs->Append(base::Value::CreateStringValue(encoded_chain[i])); | |
| 22 dict->Set("certificates", certs); | 26 dict->Set("certificates", certs); |
| 23 return dict; | 27 return dict; |
| 24 } | 28 } |
| 25 | 29 |
| 26 X509CertificateNetLogParam::~X509CertificateNetLogParam() {} | |
| 27 | |
| 28 } // namespace net | 30 } // namespace net |
| OLD | NEW |