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

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

Issue 450833002: Add additional UMA stats for remembering certificate decisions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address felt comments Created 6 years, 4 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 | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/browser/ui/webui/interstitials/interstitial_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_blocking_page.cc
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index d9cb0020a77f6c680d832d172f32f0305bf66526..d396fd1c49c0659461d0bc76aef64a0f8548e83f 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -102,24 +102,60 @@ enum SSLBlockingPageEvent {
UNUSED_BLOCKING_PAGE_EVENT,
};
+// Events for UMA. Do not reorder or change!
+enum SSLExpirationAndDecision {
+ EXPIRED_AND_PROCEED,
+ EXPIRED_AND_DO_NOT_PROCEED,
+ NOT_EXPIRED_AND_PROCEED,
+ NOT_EXPIRED_AND_DO_NOT_PROCEED,
+ END_OF_SSL_EXPIRATION_AND_DECISION,
+};
+
void RecordSSLBlockingPageEventStats(SSLBlockingPageEvent event) {
UMA_HISTOGRAM_ENUMERATION("interstitial.ssl",
event,
UNUSED_BLOCKING_PAGE_EVENT);
}
-void RecordSSLBlockingPageDetailedStats(
- bool proceed,
- int cert_error,
- bool overridable,
- bool internal,
- int num_visits,
- bool captive_portal_detection_enabled,
- bool captive_portal_probe_completed,
- bool captive_portal_no_response,
- bool captive_portal_detected) {
+void RecordSSLExpirationPageEventState(bool expired_but_previously_allowed,
+ bool proceed,
+ bool overridable) {
+ SSLExpirationAndDecision event;
+ if (expired_but_previously_allowed && proceed)
+ event = EXPIRED_AND_PROCEED;
+ else if (expired_but_previously_allowed && !proceed)
+ event = EXPIRED_AND_DO_NOT_PROCEED;
+ else if (!expired_but_previously_allowed && proceed)
+ event = NOT_EXPIRED_AND_PROCEED;
+ else
+ event = NOT_EXPIRED_AND_DO_NOT_PROCEED;
+
+ if (overridable)
felt 2014/08/12 04:56:12 style nit: I would expect { } here now that it's a
jww 2014/08/12 13:15:52 Done.
+ UMA_HISTOGRAM_ENUMERATION(
+ "interstitial.ssl.expiration_and_decision.overridable",
+ event,
+ END_OF_SSL_EXPIRATION_AND_DECISION);
+ else
+ UMA_HISTOGRAM_ENUMERATION(
+ "interstitial.ssl.expiration_and_decision.nonoverridable",
+ event,
+ END_OF_SSL_EXPIRATION_AND_DECISION);
+}
+
+void RecordSSLBlockingPageDetailedStats(bool proceed,
+ int cert_error,
+ bool overridable,
+ bool internal,
+ int num_visits,
+ bool captive_portal_detection_enabled,
+ bool captive_portal_probe_completed,
+ bool captive_portal_no_response,
+ bool captive_portal_detected,
+ bool expired_but_previously_allowed) {
UMA_HISTOGRAM_ENUMERATION("interstitial.ssl_error_type",
SSLErrorInfo::NetErrorToErrorType(cert_error), SSLErrorInfo::END_OF_ENUM);
+ RecordSSLExpirationPageEventState(
+ expired_but_previously_allowed, proceed, overridable);
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
if (captive_portal_detection_enabled)
RecordSSLBlockingPageEventStats(
@@ -269,14 +305,14 @@ void LaunchDateAndTimeSettings() {
// Note that we always create a navigation entry with SSL errors.
// No error happening loading a sub-resource triggers an interstitial so far.
-SSLBlockingPage::SSLBlockingPage(
- content::WebContents* web_contents,
- int cert_error,
- const net::SSLInfo& ssl_info,
- const GURL& request_url,
- bool overridable,
- bool strict_enforcement,
- const base::Callback<void(bool)>& callback)
+SSLBlockingPage::SSLBlockingPage(content::WebContents* web_contents,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& request_url,
+ bool overridable,
+ bool strict_enforcement,
+ bool expired_but_previously_allowed,
+ const base::Callback<void(bool)>& callback)
: callback_(callback),
web_contents_(web_contents),
cert_error_(cert_error),
@@ -290,7 +326,8 @@ SSLBlockingPage::SSLBlockingPage(
captive_portal_detection_enabled_(false),
captive_portal_probe_completed_(false),
captive_portal_no_response_(false),
- captive_portal_detected_(false) {
+ captive_portal_detected_(false),
+ expired_but_previously_allowed_(expired_but_previously_allowed) {
Profile* profile = Profile::FromBrowserContext(
web_contents->GetBrowserContext());
// For UMA stats.
@@ -341,7 +378,8 @@ SSLBlockingPage::~SSLBlockingPage() {
captive_portal_detection_enabled_,
captive_portal_probe_completed_,
captive_portal_no_response_,
- captive_portal_detected_);
+ captive_portal_detected_,
+ expired_but_previously_allowed_);
// The page is closed without the user having chosen what to do, default to
// deny.
NotifyDenyCertificate();
@@ -523,7 +561,8 @@ void SSLBlockingPage::OnProceed() {
captive_portal_detection_enabled_,
captive_portal_probe_completed_,
captive_portal_no_response_,
- captive_portal_detected_);
+ captive_portal_detected_,
+ expired_but_previously_allowed_);
// Accepting the certificate resumes the loading of the page.
NotifyAllowCertificate();
}
@@ -537,7 +576,8 @@ void SSLBlockingPage::OnDontProceed() {
captive_portal_detection_enabled_,
captive_portal_probe_completed_,
captive_portal_no_response_,
- captive_portal_detected_);
+ captive_portal_detected_,
+ expired_but_previously_allowed_);
NotifyDenyCertificate();
}
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/browser/ui/webui/interstitials/interstitial_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698