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

Unified Diff: net/cookies/canonical_cookie.cc

Issue 1411813003: Teach URLRequest about initiator checks for First-Party-Only cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 4 years, 11 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/cookies/canonical_cookie.cc
diff --git a/net/cookies/canonical_cookie.cc b/net/cookies/canonical_cookie.cc
index 2eead173bacb9065b532e2bf8831db5d00f151f4..15287e0b8b554a4e362248738c6a35866c5202b1 100644
--- a/net/cookies/canonical_cookie.cc
+++ b/net/cookies/canonical_cookie.cc
@@ -416,15 +416,9 @@ bool CanonicalCookie::IncludeForRequestURL(const GURL& url,
// match the cookie-path.
if (!IsOnPath(url.path()))
return false;
-
- // Include first-party-only cookies if:
- //
- // * |options| tells us to include all of them
- // * a first-party origin is set, and they matches the origin of |url|
- if (IsFirstPartyOnly() && !options.include_first_party_only() &&
- !options.first_party().IsSameOriginWith(url::Origin(url))) {
+ // Don't include first-party-only cookies for non-first-party requests.
+ if (IsFirstPartyOnly() && !options.include_first_party_only_cookies())
return false;
- }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698