| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/ssl_errors/error_classification.h" | 5 #include "components/ssl_errors/error_classification.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // We accept the inverse case for www for historical reasons. | 107 // We accept the inverse case for www for historical reasons. |
| 108 bool IsWWWSubDomainMatch(const GURL& request_url, | 108 bool IsWWWSubDomainMatch(const GURL& request_url, |
| 109 const net::X509Certificate& cert) { | 109 const net::X509Certificate& cert) { |
| 110 std::string www_host; | 110 std::string www_host; |
| 111 std::vector<std::string> dns_names; | 111 std::vector<std::string> dns_names; |
| 112 cert.GetDNSNames(&dns_names); | 112 cert.GetDNSNames(&dns_names); |
| 113 return GetWWWSubDomainMatch(request_url, dns_names, &www_host); | 113 return GetWWWSubDomainMatch(request_url, dns_names, &www_host); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // The time to use when doing build time operations in browser tests. | 116 // The time to use when doing build time operations in browser tests. |
| 117 base::LazyInstance<base::Time> g_testing_build_time = LAZY_INSTANCE_INITIALIZER; | 117 base::LazyInstance<base::Time>::DestructorAtExit g_testing_build_time = |
| 118 LAZY_INSTANCE_INITIALIZER; |
| 118 | 119 |
| 119 } // namespace | 120 } // namespace |
| 120 | 121 |
| 121 static ssl_errors::ErrorInfo::ErrorType RecordErrorType(int cert_error) { | 122 static ssl_errors::ErrorInfo::ErrorType RecordErrorType(int cert_error) { |
| 122 ssl_errors::ErrorInfo::ErrorType error_type = | 123 ssl_errors::ErrorInfo::ErrorType error_type = |
| 123 ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error); | 124 ssl_errors::ErrorInfo::NetErrorToErrorType(cert_error); |
| 124 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl_error_type", error_type, | 125 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl_error_type", error_type, |
| 125 ssl_errors::ErrorInfo::END_OF_ENUM); | 126 ssl_errors::ErrorInfo::END_OF_ENUM); |
| 126 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.connection_type", | 127 UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.connection_type", |
| 127 net::NetworkChangeNotifier::GetConnectionType(), | 128 net::NetworkChangeNotifier::GetConnectionType(), |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 return std::find(dns_names_domain.begin(), dns_names_domain.end() - 1, | 477 return std::find(dns_names_domain.begin(), dns_names_domain.end() - 1, |
| 477 host_name_domain) != dns_names_domain.end() - 1; | 478 host_name_domain) != dns_names_domain.end() - 1; |
| 478 } | 479 } |
| 479 | 480 |
| 480 bool IsHostnameNonUniqueOrDotless(const std::string& hostname) { | 481 bool IsHostnameNonUniqueOrDotless(const std::string& hostname) { |
| 481 return net::IsHostnameNonUnique(hostname) || | 482 return net::IsHostnameNonUnique(hostname) || |
| 482 hostname.find('.') == std::string::npos; | 483 hostname.find('.') == std::string::npos; |
| 483 } | 484 } |
| 484 | 485 |
| 485 } // namespace ssl_errors | 486 } // namespace ssl_errors |
| OLD | NEW |