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

Side by Side Diff: chrome/browser/ssl/ssl_error_classification.cc

Issue 839183002: Remove redundancy in security interstitial UMA logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ... Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "chrome/browser/ssl/ssl_error_classification.h" 7 #include "chrome/browser/ssl/ssl_error_classification.h"
8 8
9 #include "base/build_time.h" 9 #include "base/build_time.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 if (IsHostnameNonUniqueOrDotless(request_url_.HostNoBrackets())) 290 if (IsHostnameNonUniqueOrDotless(request_url_.HostNoBrackets()))
291 severity_authority_score += kClientWeight * kPrivateURLWeight; 291 severity_authority_score += kClientWeight * kPrivateURLWeight;
292 292
293 RecordSSLInterstitialSeverityScore(severity_authority_score, cert_error_); 293 RecordSSLInterstitialSeverityScore(severity_authority_score, cert_error_);
294 } 294 }
295 295
296 void SSLErrorClassification::RecordUMAStatistics( 296 void SSLErrorClassification::RecordUMAStatistics(
297 bool overridable) const { 297 bool overridable) const {
298 SSLErrorInfo::ErrorType type = 298 SSLErrorInfo::ErrorType type =
299 SSLErrorInfo::NetErrorToErrorType(cert_error_); 299 SSLErrorInfo::NetErrorToErrorType(cert_error_);
300 UMA_HISTOGRAM_ENUMERATION(
301 "interstitial.ssl_error_type", type, SSLErrorInfo::END_OF_ENUM);
300 switch (type) { 302 switch (type) {
301 case SSLErrorInfo::CERT_DATE_INVALID: { 303 case SSLErrorInfo::CERT_DATE_INVALID: {
302 if (IsUserClockInThePast(base::Time::NowFromSystemTime())) 304 if (IsUserClockInThePast(base::Time::NowFromSystemTime()))
303 RecordSSLInterstitialCause(overridable, CLOCK_PAST); 305 RecordSSLInterstitialCause(overridable, CLOCK_PAST);
304 if (IsUserClockInTheFuture(base::Time::NowFromSystemTime())) 306 if (IsUserClockInTheFuture(base::Time::NowFromSystemTime()))
305 RecordSSLInterstitialCause(overridable, CLOCK_FUTURE); 307 RecordSSLInterstitialCause(overridable, CLOCK_FUTURE);
306 break; 308 break;
307 } 309 }
308 case SSLErrorInfo::CERT_COMMON_NAME_INVALID: { 310 case SSLErrorInfo::CERT_COMMON_NAME_INVALID: {
309 std::string host_name = request_url_.host(); 311 std::string host_name = request_url_.host();
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 // sure we don't clear the captive protal flag, since the interstitial was 648 // sure we don't clear the captive protal flag, since the interstitial was
647 // potentially caused by the captive portal. 649 // potentially caused by the captive portal.
648 captive_portal_detected_ = captive_portal_detected_ || 650 captive_portal_detected_ = captive_portal_detected_ ||
649 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); 651 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL);
650 // Also keep track of non-HTTP portals and error cases. 652 // Also keep track of non-HTTP portals and error cases.
651 captive_portal_no_response_ = captive_portal_no_response_ || 653 captive_portal_no_response_ = captive_portal_no_response_ ||
652 (results->result == captive_portal::RESULT_NO_RESPONSE); 654 (results->result == captive_portal::RESULT_NO_RESPONSE);
653 } 655 }
654 #endif 656 #endif
655 } 657 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698