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

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

Issue 1783813002: SameSite: Strict/Lax behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@strict-lax
Patch Set: Moar. 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.cc
diff --git a/net/base/registry_controlled_domains/registry_controlled_domain.cc b/net/base/registry_controlled_domains/registry_controlled_domain.cc
index 0d98eada13b9c7c700e385c7e30c79560b2a5f34..3c2c95dbcbfcc631a1c58be908e198aa2c111757 100644
--- a/net/base/registry_controlled_domains/registry_controlled_domain.cc
+++ b/net/base/registry_controlled_domains/registry_controlled_domain.cc
@@ -52,6 +52,7 @@
#include "net/base/net_module.h"
#include "net/base/url_util.h"
#include "url/gurl.h"
+#include "url/origin.h"
#include "url/third_party/mozilla/url_parse.h"
namespace net {
@@ -215,6 +216,16 @@ bool SameDomainOrHost(
host1.len);
}
+bool SameDomainOrHost(const url::Origin& origin1,
+ const url::Origin& origin2,
+ PrivateRegistryFilter filter) {
+ if (origin1.unique() || origin2.unique())
mmenke 2016/03/17 19:15:56 Why doesn't SameDomainOrHost need this check? Als
Mike West 2016/03/17 19:57:12 This is leftover from a previous version; we don't
+ return false;
+
+ return SameDomainOrHost(GURL(origin1.Serialize()), GURL(origin2.Serialize()),
+ filter);
mmenke 2016/03/17 19:15:56 This seems backwards. Really seems like SameDomai
Mike West 2016/03/17 19:57:12 I thought about that, but we'd need to add some in
mmenke 2016/03/18 15:58:12 Didn't respond to this, but I think it's fine for
+}
+
size_t GetRegistryLength(
const GURL& gurl,
UnknownRegistryFilter unknown_filter,

Powered by Google App Engine
This is Rietveld 408576698