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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2099243002: PlzNavigate: properly set the initiator of the navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 16cb92373be9fb64b21773abf7a3ca6e8ae48daf..224bf85fb9886968ecdb95c9153869bd9aa6dd72 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -86,6 +86,10 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
if (frame_entry.method() == "POST")
request_body = frame_entry.GetPostData();
+ url::Origin initiator =
+ frame_tree_node->IsMainFrame()
+ ? url::Origin(dest_url)
nasko 2016/06/28 18:32:22 This just feels wrong. Why would the initiator be
clamy 2016/06/29 11:23:20 I based myself on https://cs.chromium.org/chromium
+ : frame_tree_node->frame_tree()->root()->current_origin();
std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
frame_tree_node, entry.ConstructCommonNavigationParams(
frame_entry, request_body, dest_url, dest_referrer,
@@ -94,7 +98,7 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
LoadFlagFromNavigationType(navigation_type),
false, // has_user_gestures
false, // skip_service_worker
- REQUEST_CONTEXT_TYPE_LOCATION),
+ REQUEST_CONTEXT_TYPE_LOCATION, initiator),
entry.ConstructRequestNavigationParams(
frame_entry, is_same_document_history_load,
frame_tree_node->has_committed_real_load(),
@@ -188,8 +192,8 @@ NavigationRequest::NavigationRequest(
false : frame_tree_node->parent()->IsMainFrame();
info_.reset(new NavigationRequestInfo(
common_params, begin_params, first_party_for_cookies,
- frame_tree_node->current_origin(), frame_tree_node->IsMainFrame(),
- parent_is_main_frame, frame_tree_node->frame_tree_node_id()));
+ frame_tree_node->IsMainFrame(), parent_is_main_frame,
+ frame_tree_node->frame_tree_node_id()));
}
NavigationRequest::~NavigationRequest() {
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request_info.h » ('j') | content/common/navigation_params.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698