Index: chrome/browser/ssl/ssl_error_classification.cc |
diff --git a/chrome/browser/ssl/ssl_error_classification.cc b/chrome/browser/ssl/ssl_error_classification.cc |
index 6ee60710b334d795927e2cec6c1b3a7058eb3f95..ac32985403541a411d46750fc398cbb10abb58e5 100644 |
--- a/chrome/browser/ssl/ssl_error_classification.cc |
+++ b/chrome/browser/ssl/ssl_error_classification.cc |
@@ -65,6 +65,21 @@ enum SSLInterstitialCauseCaptivePortal { |
UNUSED_CAPTIVE_PORTAL_EVENT, |
}; |
+void RecordSSLInterstitialSeverityScore(float ssl_severity_score, |
+ int cert_error) { |
+ if (SSLErrorInfo::NetErrorToErrorType(cert_error) == |
+ SSLErrorInfo::CERT_DATE_INVALID) { |
+ UMA_HISTOGRAM_COUNTS_100("interstitial.ssl.severity_score.date_invalid", |
Ryan Sleevi
2014/09/11 20:56:25
UMA_HISTOGRAM_COUNTS_100 creates 50 buckets for 1-
|
+ static_cast<int>(ssl_severity_score * 100)); |
+ } |
+ if (SSLErrorInfo::NetErrorToErrorType(cert_error) == |
+ SSLErrorInfo::CERT_COMMON_NAME_INVALID) { |
Ryan Sleevi
2014/09/11 20:51:07
These are mutually exclusive conditions, right? Wo
palmer
2014/09/11 20:58:30
Done.
|
+ UMA_HISTOGRAM_COUNTS_100( |
+ "interstitial.ssl.severity_score.common_name_invalid", |
+ static_cast<int>(ssl_severity_score * 100)); |
+ } |
+} |
+ |
// Scores/weights which will be constant through all the SSL error types. |
static const float kServerWeight = 0.5f; |
static const float kClientWeight = 0.5f; |
@@ -207,8 +222,8 @@ void SSLErrorClassification::InvalidDateSeverityScore() { |
} |
if (current_time_ < cert_.valid_start()) |
severity_date_score += kServerWeight * kNotYetValidWeight; |
- // TODO(felt): Record the severity score in a histogram. This will be |
- // in the next CL - just called the function in ssl_blocking_page.cc. |
+ |
+ RecordSSLInterstitialSeverityScore(severity_date_score, cert_error_); |
} |
void SSLErrorClassification::InvalidCommonNameSeverityScore() { |
@@ -246,9 +261,8 @@ void SSLErrorClassification::InvalidCommonNameSeverityScore() { |
severity_name_score += kClientWeight * kEnvironmentWeight * |
CalculateScoreEnvironments(); |
- // TODO(felt): Record the severity score in a histogram. Same as above |
- // - this will be in the next CL. So just called the function in the |
- // ssl_blocking_page.cc. |
+ |
+ RecordSSLInterstitialSeverityScore(severity_name_score, cert_error_); |
} |
void SSLErrorClassification::RecordUMAStatistics( |