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

Unified Diff: extensions/common/csp_validator.cc

Issue 2456643005: Reduce buggy usage of the registry controlled domain service. (Closed)
Patch Set: Fix 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: extensions/common/csp_validator.cc
diff --git a/extensions/common/csp_validator.cc b/extensions/common/csp_validator.cc
index 22a1325396ded0dc6aedce2041102348efbf3387..e6c789f6f8e59fce0d2afdc732efac15d82a37f6 100644
--- a/extensions/common/csp_validator.cc
+++ b/extensions/common/csp_validator.cc
@@ -118,11 +118,9 @@ bool isNonWildcardTLD(const std::string& url,
return true;
// Wildcards on subdomains of a TLD are not allowed.
- size_t registry_length = net::registry_controlled_domains::GetRegistryLength(
- host,
- net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES,
+ return net::registry_controlled_domains::HostHasRegistryControlledDomain(
+ host, net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES,
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
- return registry_length != 0;
}
// Checks whether the source is a syntactically valid hash.
« no previous file with comments | « content/renderer/webpublicsuffixlist_impl.cc ('k') | extensions/common/manifest_handlers/externally_connectable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698