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

Unified 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: Fix headers 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 side-by-side diff with in-line comments
Download patch
Index: net/base/x509_certificate_net_log_param.cc
===================================================================
--- net/base/x509_certificate_net_log_param.cc (revision 141407)
+++ net/base/x509_certificate_net_log_param.cc (working copy)
@@ -4,25 +4,27 @@
#include "net/base/x509_certificate_net_log_param.h"
+#include <string>
+#include <vector>
+
#include "base/values.h"
#include "net/base/x509_certificate.h"
namespace net {
-X509CertificateNetLogParam::X509CertificateNetLogParam(
- X509Certificate* certificate) {
- certificate->GetPEMEncodedChain(&encoded_chain_);
-}
-
-base::Value* X509CertificateNetLogParam::ToValue() const {
+base::Value* NetLogX509CertificateNetLogCallback(
+ 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.
+ NetLog::LogLevel log_level) {
+ 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
+ return NULL;
DictionaryValue* dict = new DictionaryValue();
ListValue* certs = new ListValue();
- for (size_t i = 0; i < encoded_chain_.size(); ++i)
- certs->Append(base::Value::CreateStringValue(encoded_chain_[i]));
+ std::vector<std::string> encoded_chain;
+ certificate->GetPEMEncodedChain(&encoded_chain);
+ for (size_t i = 0; i < encoded_chain.size(); ++i)
+ certs->Append(base::Value::CreateStringValue(encoded_chain[i]));
dict->Set("certificates", certs);
return dict;
}
-X509CertificateNetLogParam::~X509CertificateNetLogParam() {}
-
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698