Index: net/socket/ssl_host_info.cc |
diff --git a/net/socket/ssl_host_info.cc b/net/socket/ssl_host_info.cc |
index 1fcc0530b09beb86a266d3d949d37e71ce10467d..bd7a4adfe74e293849dd755f9b2753a8df6d2774 100644 |
--- a/net/socket/ssl_host_info.cc |
+++ b/net/socket/ssl_host_info.cc |
@@ -76,6 +76,20 @@ SSLHostInfo::State* SSLHostInfo::mutable_state() { |
return &state_; |
} |
+void SSLHostInfo::set_cert_verification_finished_time() { |
+#if defined(OS_LINUX) |
+ if (dnsrr_resolver_ && dns_handle_ == DnsRRResolver::kInvalidHandle) { |
+ // We have completed the DNS lookup already. Therefore, waiting for the DNS |
+ // lookup would cause no delay. |
+ UMA_HISTOGRAM_TIMES("Net.SSLHostInfoDNSLookupDelayMs", base::TimeDelta()); |
+ } else { |
+ // The actual delay will be calculated when the DNS lookup finishes, in |
+ // DnsComplete. |
+ cert_verification_finished_time_ = base::TimeTicks::Now(); |
+ } |
+#endif |
+} |
+ |
bool SSLHostInfo::Parse(const std::string& data) { |
State* state = mutable_state(); |
@@ -224,10 +238,16 @@ void SSLHostInfo::DnsComplete(int rv) { |
dns_callback_ = NULL; |
const base::TimeTicks now = base::TimeTicks::Now(); |
- const base::TimeDelta elapsed = now - dns_lookup_start_time_; |
+ base::TimeDelta elapsed = now - dns_lookup_start_time_; |
UMA_HISTOGRAM_TIMES("Net.SSLHostInfoDNSLookup", elapsed); |
+ |
+ if (!cert_verification_finished_time_.is_null()) { |
+ elapsed = now - cert_verification_finished_time_; |
+ UMA_HISTOGRAM_TIMES("Net.SSLHostInfoDNSLookupDelayMs", elapsed); |
+ } |
} |
+ |
SSLHostInfoFactory::~SSLHostInfoFactory() {} |
} // namespace net |