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

Unified Diff: net/socket/ssl_host_info.cc

Issue 4408001: net: Make Snap Start check cert verification and add metrics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « net/socket/ssl_host_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_host_info.cc
diff --git a/net/socket/ssl_host_info.cc b/net/socket/ssl_host_info.cc
index ce042dee5a8470efd4f79c73534daeb5dcd384e9..fbd715f75ada5cdbb5cc06270ad55dd1854dc9dc 100644
--- a/net/socket/ssl_host_info.cc
+++ b/net/socket/ssl_host_info.cc
@@ -4,6 +4,7 @@
#include "net/socket/ssl_host_info.h"
+#include "base/metrics/histogram.h"
#include "base/string_piece.h"
#include "net/base/cert_verifier.h"
#include "net/base/ssl_config_service.h"
@@ -110,6 +111,7 @@ bool SSLHostInfo::Parse(const std::string& data) {
flags |= X509Certificate::VERIFY_REV_CHECKING_ENABLED;
verifier_.reset(new CertVerifier);
VLOG(1) << "Kicking off verification for " << hostname_;
+ verification_start_time_ = base::TimeTicks::Now();
if (verifier_->Verify(cert_.get(), hostname_, flags,
&cert_verify_result_, callback_) == OK) {
VerifyCallback(OK);
@@ -156,6 +158,10 @@ int SSLHostInfo::WaitForCertVerification(CompletionCallback* callback) {
}
void SSLHostInfo::VerifyCallback(int rv) {
Mike Belshe 2010/11/03 19:55:11 nit: add DCHECK(!verification_start_time().is_nul
+ base::TimeTicks now = base::TimeTicks::Now();
+ const base::TimeDelta duration = now - verification_start_time();
+ UMA_HISTOGRAM_TIMES("Net.SSLHostInfoVerificationTimeMs", duration);
+ VLOG(1) << "Verification took " << duration.InMilliseconds() << "ms";
cert_verification_complete_ = true;
cert_verification_result_ = rv;
if (cert_verification_callback_) {
« no previous file with comments | « net/socket/ssl_host_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698