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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2953583002: PlzNavigate: fix empty FirstPartyForCookies in tests. (Closed)
Patch Set: Do not put it into WillSendRequest because of initiator Created 3 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 a10d6b04d0ea6d03d483c30eafca6bda8ae38b1b..027b5a62183d12af29a1e4285ea9da43a90b6056 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6286,6 +6286,14 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
blink::WebURLRequest& request = info.url_request;
+ // Set RequestorOrigin and FirstPartyForCookies
+ WebDocument frame_document = frame_->GetDocument();
+ if (request.GetFrameType() == blink::WebURLRequest::kFrameTypeTopLevel)
+ request.SetFirstPartyForCookies(request.Url());
+ else
+ request.SetFirstPartyForCookies(frame_document.FirstPartyForCookies());
+ request.SetRequestorOrigin(frame_document.GetSecurityOrigin());
+
// Note: At this stage, the goal is to apply all the modifications the
// renderer wants to make to the request, and then send it to the browser, so
// that the actual network request can be started. Ideally, all such
@@ -6298,14 +6306,6 @@ void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
// else in blink.
WillSendRequest(request);
- // Set RequestorOrigin and FirstPartyForCookies.
- WebDocument frame_document = frame_->GetDocument();
- if (request.GetFrameType() == blink::WebURLRequest::kFrameTypeTopLevel)
- request.SetFirstPartyForCookies(request.Url());
- else
- request.SetFirstPartyForCookies(frame_document.FirstPartyForCookies());
- request.SetRequestorOrigin(frame_document.GetSecurityOrigin());
-
// Update the transition type of the request for client side redirects.
if (!info.url_request.GetExtraData())
info.url_request.SetExtraData(new RequestExtraData());
« 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