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

Unified Diff: net/cert/multi_threaded_cert_verifier.cc

Issue 303133006: Added net_log logging statments for CertVerifyResult (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed various comments on last CL Created 6 years, 7 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/cert/multi_threaded_cert_verifier.cc
diff --git a/net/cert/multi_threaded_cert_verifier.cc b/net/cert/multi_threaded_cert_verifier.cc
index f1b9bb8d1faf19c95a9b231314bebeb6528bc3fd..a9bcdd1ca8cb78a84b2f80601fad6835f98e1b79 100644
--- a/net/cert/multi_threaded_cert_verifier.cc
+++ b/net/cert/multi_threaded_cert_verifier.cc
@@ -15,8 +15,9 @@
#include "base/synchronization/lock.h"
#include "base/threading/worker_pool.h"
#include "base/time/time.h"
+#include "net/base/hash_value.h"
#include "net/base/net_errors.h"
-#include "net/base/net_log.h"
+#include "net/cert/cert_status_flags.h"
#include "net/cert/cert_trust_anchor_provider.h"
#include "net/cert/cert_verify_proc.h"
#include "net/cert/crl_set.h"
@@ -350,8 +351,13 @@ class CertVerifierJob {
void HandleResult(
const MultiThreadedCertVerifier::CachedResult& verify_result,
bool is_first_job) {
+ /* net_log_.AddEvent(
+ NetLog::TYPE_CERT_VERIFIER_JOB,
+ base::Bind(&CertVerifyResultCallback, verify_result.result));*/
Ryan Sleevi 2014/05/31 00:53:02 Delete, not comment :)
mshelley 2014/05/31 01:50:39 Done. My mistake -- I meant to go back and delete
worker_ = NULL;
- net_log_.EndEvent(NetLog::TYPE_CERT_VERIFIER_JOB);
+ net_log_.EndEvent(
+ NetLog::TYPE_CERT_VERIFIER_JOB,
+ base::Bind(&CertVerifyResultCallback, verify_result.result));
base::TimeDelta latency = base::TimeTicks::Now() - start_time_;
UMA_HISTOGRAM_CUSTOM_TIMES("Net.CertVerifier_Job_Latency",
latency,
@@ -583,3 +589,35 @@ void MultiThreadedCertVerifier::OnCACertChanged(
}
} // namespace net
+
+namespace {
+
+base::Value* CertVerifyResultCallback(net::CertVerifyResult verify_result,
+ net::NetLog::LogLevel log_level) {
+ base::DictionaryValue* results = new base::DictionaryValue();
+ results->SetBoolean("has_md5", verify_result.has_md5);
+ results->SetBoolean("has_md2", verify_result.has_md2);
+ results->SetBoolean("has_md4", verify_result.has_md4);
+ results->SetBoolean("is_issued_by_known_root",
+ verify_result.is_issued_by_known_root);
+ results->SetBoolean("is_issued_by_additional_trust_anchor",
+ verify_result.is_issued_by_additional_trust_anchor);
+ results->SetBoolean("common_name_fallback_used",
+ verify_result.common_name_fallback_used);
+ results->SetInteger("cert_status", verify_result.cert_status);
+ results->Set("verified_cert",
+ net::NetLogX509CertificateCallback(verify_result.verified_cert,
+ net::NetLog::LOG_ALL));
Ryan Sleevi 2014/05/31 00:53:02 Just pass your log level that you receive as the p
mshelley 2014/05/31 01:50:39 Done.
+ base::ListValue* hashes = new base::ListValue();
+ for (std::vector<net::HashValue>::const_iterator it =
+ verify_result.public_key_hashes.begin();
+ it != verify_result.public_key_hashes.end();
+ it++) {
+ hashes->AppendString(it->ToString());
+ }
+
+ results->Set("public_key_hashes", hashes);
+
+ return results;
+}
+}
« net/cert/multi_threaded_cert_verifier.h ('K') | « net/cert/multi_threaded_cert_verifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698