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

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

Issue 1783813002: SameSite: Strict/Lax behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@strict-lax
Patch Set: Comment. Created 4 years, 9 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: 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

Powered by Google App Engine
This is Rietveld 408576698