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

Unified Diff: net/base/registry_controlled_domains/registry_controlled_domain.cc

Issue 2568133007: Allow CrossSiteDocumentClassifier to operate on Origins (Closed)
Patch Set: rebase Created 4 years 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
« no previous file with comments | « net/base/registry_controlled_domains/registry_controlled_domain.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/registry_controlled_domains/registry_controlled_domain.cc
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain.cc b/net/base/registry_controlled_domains/registry_controlled_domain.cc
index 5f29f89f27cacdd71154db87177dd39ab6a224da..7c4ef3efb76bbf41b055714eb5e1219e781254c9 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain.cc
+++ b/net/base/registry_controlled_domains/registry_controlled_domain.cc
@@ -309,6 +309,23 @@ size_t DoPermissiveGetHostRegistryLength(base::BasicStringPiece<Str> host,
return canonical_rcd_len;
}
+} // namespace
+
+std::string GetDomainAndRegistry(const GURL& gurl,
+ PrivateRegistryFilter filter) {
+ return GetDomainAndRegistryAsStringPiece(gurl.host_piece(), filter)
+ .as_string();
+}
+
+std::string GetDomainAndRegistry(base::StringPiece host,
+ PrivateRegistryFilter filter) {
+ url::CanonHostInfo host_info;
+ const std::string canon_host(CanonicalizeHost(host, &host_info));
+ if (canon_host.empty() || host_info.IsIPAddress())
+ return std::string();
+ return GetDomainAndRegistryImpl(canon_host, filter).as_string();
+}
+
bool SameDomainOrHost(base::StringPiece host1,
base::StringPiece host2,
PrivateRegistryFilter filter) {
@@ -328,27 +345,9 @@ bool SameDomainOrHost(base::StringPiece host1,
(domain1 == GetDomainAndRegistryAsStringPiece(host2, filter));
}
-} // namespace
-
-std::string GetDomainAndRegistry(const GURL& gurl,
- PrivateRegistryFilter filter) {
- return GetDomainAndRegistryAsStringPiece(gurl.host_piece(), filter)
- .as_string();
-}
-
-std::string GetDomainAndRegistry(base::StringPiece host,
- PrivateRegistryFilter filter) {
- url::CanonHostInfo host_info;
- const std::string canon_host(CanonicalizeHost(host, &host_info));
- if (canon_host.empty() || host_info.IsIPAddress())
- return std::string();
- return GetDomainAndRegistryImpl(canon_host, filter).as_string();
-}
-
-bool SameDomainOrHost(
- const GURL& gurl1,
- const GURL& gurl2,
- PrivateRegistryFilter filter) {
+bool SameDomainOrHost(const GURL& gurl1,
+ const GURL& gurl2,
+ PrivateRegistryFilter filter) {
return SameDomainOrHost(gurl1.host_piece(), gurl2.host_piece(), filter);
}
« no previous file with comments | « net/base/registry_controlled_domains/registry_controlled_domain.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698