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 fa72f4cf450946fb4d805ebfe5b44aa59e0f0228..24ffb707a50ab5fd44e7b7f86427a9dfd0bff8b6 100644 |
--- a/net/base/registry_controlled_domains/registry_controlled_domain.h |
+++ b/net/base/registry_controlled_domains/registry_controlled_domain.h |
@@ -122,6 +122,10 @@ |
class GURL; |
+namespace url { |
+class Origin; |
+}; |
+ |
struct DomainRule; |
namespace net { |
@@ -183,8 +187,8 @@ NET_EXPORT std::string GetDomainAndRegistry(const GURL& gurl, |
NET_EXPORT std::string GetDomainAndRegistry(base::StringPiece host, |
PrivateRegistryFilter filter); |
-// This convenience function returns true if the two GURLs both have hosts |
-// and one of the following is true: |
+// 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. |
@@ -192,6 +196,9 @@ NET_EXPORT std::string GetDomainAndRegistry(base::StringPiece host, |
// represent hosts "on the same site". |
NET_EXPORT bool SameDomainOrHost(const GURL& gurl1, const GURL& gurl2, |
PrivateRegistryFilter filter); |
+NET_EXPORT bool SameDomainOrHost(const url::Origin& origin1, |
+ const url::Origin& origin2, |
+ PrivateRegistryFilter filter); |
// Finds the length in bytes of the registrar portion of the host in the |
// given GURL. Returns std::string::npos if the GURL is invalid or has no |