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

Unified Diff: components/ssl_errors/error_classification.cc

Issue 2433583002: Reduce buggy usage of the registry controlled domain service. (Closed)
Patch Set: . Created 4 years, 2 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
Index: components/ssl_errors/error_classification.cc
diff --git a/components/ssl_errors/error_classification.cc b/components/ssl_errors/error_classification.cc
index c61b3262aca91ceeb9df8e5f83ba5a1fa6e209a4..7498ac728fc88311f1366a19d15006f6f6402a86 100644
--- a/components/ssl_errors/error_classification.cc
+++ b/components/ssl_errors/error_classification.cc
@@ -279,12 +279,10 @@ void SetBuildTimeForTesting(const base::Time& testing_time) {
}
bool IsHostNameKnownTLD(const std::string& host_name) {
- size_t tld_length = net::registry_controlled_domains::GetRegistryLength(
- host_name, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+ return net::registry_controlled_domains::HostHasRegistryControlledDomain(
+ host_name,
+ net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
- if (tld_length == 0 || tld_length == std::string::npos)
- return false;
- return true;
}
HostnameTokens Tokenize(const std::string& name) {

Powered by Google App Engine
This is Rietveld 408576698