Chromium Code Reviews| 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..b12bae9f8971beeb4b6df2e8d3af526743a70de0 100644 |
| --- a/chrome/browser/ssl/ssl_error_classification.cc |
| +++ b/chrome/browser/ssl/ssl_error_classification.cc |
| @@ -65,6 +65,22 @@ 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_CUSTOM_COUNTS("interstitial.ssl.severity_score.date_invalid", |
|
felt
2014/09/09 01:11:20
should this one be UMA_HISTOGRAM_COUNTS_100 too?
palmer
2014/09/11 18:03:48
bool oops_youre_right = static_cast<bool>("totes")
|
| + static_cast<int>(ssl_severity_score * 100), |
| + 0, 100, 20); |
| + } |
| + if (SSLErrorInfo::NetErrorToErrorType(cert_error) == |
| + SSLErrorInfo::CERT_COMMON_NAME_INVALID) { |
| + 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 +223,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 +262,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( |