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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2084333002: Correctly set 'firstPartyForCookies' in 'RenderFrameImpl::willSendRequest'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed one. Created 4 years, 6 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 | « content/browser/loader/resource_dispatcher_host_browsertest.cc ('k') | content/test/data/simple_links.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c92437cec6572ab2536fb4212d53e6790d391c5a..eedba7ad380c84503cd9450d07de2f7c55a35b61 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3928,17 +3928,10 @@ void RenderFrameImpl::willSendRequest(
// requests). This value will be updated during redirects, consistent with
// https://tools.ietf.org/html/draft-west-first-party-cookies-04#section-2.1.1
if (request.firstPartyForCookies().isEmpty()) {
- if (request.getFrameType() == blink::WebURLRequest::FrameTypeTopLevel) {
+ if (request.getFrameType() == blink::WebURLRequest::FrameTypeTopLevel)
request.setFirstPartyForCookies(request.url());
- } else {
- // TODO(nasko): When the top-level frame is remote, there is no document.
- // This is broken and should be fixed to propagate the first party.
- WebFrame* top = frame->top();
- if (top->isWebLocalFrame()) {
- request.setFirstPartyForCookies(
- frame->top()->document().firstPartyForCookies());
- }
- }
+ else
+ request.setFirstPartyForCookies(frame->document().firstPartyForCookies());
// If we need to set the first party, then we need to set the request's
// initiator as well; it will not be updated during redirects.
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_browsertest.cc ('k') | content/test/data/simple_links.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698