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

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: Now with more building! 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') | tools/metrics/histograms/histograms.xml » ('J')
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..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(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698