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

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: Addressed Przemek's comment 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..c00db3e1d8a9dd7da55b8fc4df4f4c4e92092344 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2353,6 +2353,17 @@ 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().firstPartyForCookies());
+ }
+ }
+
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