| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |