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

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

Issue 2393163002: Factor out SameHost() in registry_controlled_domains
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
« no previous file with comments | « no previous file | net/base/registry_controlled_domains/registry_controlled_domain.cc » ('j') | 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.h
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain.h b/net/base/registry_controlled_domains/registry_controlled_domain.h
index 89aa6d6c18bc351d26a862a8f8fa79ef70aa325f..19514def02535e8f045798bfcf9d361216775ad8 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain.h
+++ b/net/base/registry_controlled_domains/registry_controlled_domain.h
@@ -195,11 +195,15 @@ NET_EXPORT base::StringPiece GetDomainAndRegistryAsStringPiece(
NET_EXPORT std::string GetDomainAndRegistry(base::StringPiece host,
PrivateRegistryFilter filter);
+// Returns whether the hosts of the GURLs are identical.
engedy 2016/10/21 08:43:22 nit: Maybe we could put this into the anonymous na
+NET_EXPORT bool SameHost(const GURL& gurl1, const GURL& gurl2);
+
// These convenience functions return true if the two GURLs or Origins both have
// hosts and one of the following is true:
// * They each have a known domain and registry, and it is the same for both
// URLs. Note that this means the trailing dot, if any, must match too.
-// * They don't have known domains/registries, but the hosts are identical.
+// * They don't have known domains/registries, but the hosts are identical
+// (determined by the SameHost function above).
// Effectively, callers can use this function to check whether the input URLs
// represent hosts "on the same site".
NET_EXPORT bool SameDomainOrHost(const GURL& gurl1, const GURL& gurl2,
« no previous file with comments | « no previous file | net/base/registry_controlled_domains/registry_controlled_domain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698