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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 317853002: Set the first party for cookies url in RenderFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | 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 cfce1ee9392a594905860c1e3c5027f6c39cb55e..3d89f8ff46d4669bcd5aae03ae7821a37515dab5 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2353,6 +2353,15 @@ void RenderFrameImpl::willSendRequest(
if (request.url().isEmpty())
return;
+ // Set the first party for cookies url if it has not been set yet (new
+ // requests). For redirects, it is updated by WebURLLoaderImpl.
+ if (request.firstPartyForCookies().isEmpty()) {
+ if (request.targetType() == blink::WebURLRequest::TargetIsMainFrame)
+ request.setFirstPartyForCookies(request.url());
+ else
+ request.setFirstPartyForCookies(frame->top()->document().url());
ppi 2014/06/05 15:27:16 Does it matter that we changed from ::firstPartyFo
clamy 2014/06/05 15:33:27 firstPartyForCookies is not in the public blink AP
ppi 2014/06/05 15:41:43 I agree it's probably fine, but the function seems
clamy 2014/06/05 16:05:00 My bad, missed it. In that case I agree that it is
+ }
+
WebFrame* top_frame = frame->top();
if (!top_frame)
top_frame = frame;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698