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

Side by Side Diff: components/ssl_errors/error_classification.h

Issue 2184263002: Fix an ssl_errors comment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef COMPONENTS_SSL_ERRORS_ERROR_CLASSIFICATION_H_ 5 #ifndef COMPONENTS_SSL_ERRORS_ERROR_CLASSIFICATION_H_
6 #define COMPONENTS_SSL_ERRORS_ERROR_CLASSIFICATION_H_ 6 #define COMPONENTS_SSL_ERRORS_ERROR_CLASSIFICATION_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void RecordUMAStatisticsForClockInterstitial(bool overridable, 101 void RecordUMAStatisticsForClockInterstitial(bool overridable,
102 ssl_errors::ClockState clock_state, 102 ssl_errors::ClockState clock_state,
103 int cert_error); 103 int cert_error);
104 104
105 // Helper methods for classification. ------------------------------------------ 105 // Helper methods for classification. ------------------------------------------
106 106
107 // Tokenize DNS names and hostnames. 107 // Tokenize DNS names and hostnames.
108 HostnameTokens Tokenize(const std::string& name); 108 HostnameTokens Tokenize(const std::string& name);
109 109
110 // Sets a clock for browser tests that check the build time. Used by 110 // Sets a clock for browser tests that check the build time. Used by
111 // IsUserClockInThePast and IsUserClockInTheFuture. 111 // GetClockState().
112 void SetBuildTimeForTesting(const base::Time& testing_time); 112 void SetBuildTimeForTesting(const base::Time& testing_time);
113 113
114 // Returns true if the hostname has a known Top Level Domain. 114 // Returns true if the hostname has a known Top Level Domain.
115 bool IsHostNameKnownTLD(const std::string& host_name); 115 bool IsHostNameKnownTLD(const std::string& host_name);
116 116
117 // Returns true if any one of the following conditions hold: 117 // Returns true if any one of the following conditions hold:
118 // 1.|hostname| is an IP Address in an IANA-reserved range. 118 // 1.|hostname| is an IP Address in an IANA-reserved range.
119 // 2.|hostname| is a not-yet-assigned by ICANN gTLD. 119 // 2.|hostname| is a not-yet-assigned by ICANN gTLD.
120 // 3.|hostname| is a dotless domain. 120 // 3.|hostname| is a dotless domain.
121 bool IsHostnameNonUniqueOrDotless(const std::string& hostname); 121 bool IsHostnameNonUniqueOrDotless(const std::string& hostname);
122 122
123 // Returns true if |child| is a subdomain of any of the |potential_parents|. 123 // Returns true if |child| is a subdomain of any of the |potential_parents|.
124 bool NameUnderAnyNames(const HostnameTokens& child, 124 bool NameUnderAnyNames(const HostnameTokens& child,
125 const std::vector<HostnameTokens>& potential_parents); 125 const std::vector<HostnameTokens>& potential_parents);
126 126
127 // Returns true if any of the |potential_children| is a subdomain of the 127 // Returns true if any of the |potential_children| is a subdomain of the
128 // |parent|. The inverse case should be treated carefully as this is most 128 // |parent|. The inverse case should be treated carefully as this is most
129 // likely a MITM attack. We don't want foo.appspot.com to be able to MITM for 129 // likely a MITM attack. We don't want foo.appspot.com to be able to MITM for
130 // appspot.com. 130 // appspot.com.
131 bool AnyNamesUnderName(const std::vector<HostnameTokens>& potential_children, 131 bool AnyNamesUnderName(const std::vector<HostnameTokens>& potential_children,
132 const HostnameTokens& parent); 132 const HostnameTokens& parent);
133 133
134 // Exposed for teshting. 134 // Exposed for teshting.
135 size_t GetLevenshteinDistance(const std::string& str1, const std::string& str2); 135 size_t GetLevenshteinDistance(const std::string& str1, const std::string& str2);
136 136
137 } // namespace ssl_errors 137 } // namespace ssl_errors
138 138
139 #endif // COMPONENTS_SSL_ERRORS_ERROR_CLASSIFICATION_H_ 139 #endif // COMPONENTS_SSL_ERRORS_ERROR_CLASSIFICATION_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698