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

Unified Diff: chrome/browser/ssl/ssl_error_classification.cc

Issue 549363002: Add histograms to record the severity scores for certain SSL errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and respond to comments. Created 6 years, 3 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698