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

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 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 | content/browser/frame_host/navigation_request_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 efa835bc70856ae27a3d2192bafbde81b4d238e7..2c04eda2a0049f3e5b9213d0edae444f6add6b2b 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -209,6 +209,11 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
if (frame_entry.method() == "POST")
request_body = frame_entry.GetPostData();
+ base::Optional<url::Origin> initiator =
+ frame_tree_node->IsMainFrame()
+ ? base::Optional<url::Origin>()
+ : base::Optional<url::Origin>(
+ 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,
@@ -216,7 +221,7 @@ std::unique_ptr<NavigationRequest> NavigationRequest::CreateBrowserInitiated(
BeginNavigationParams(entry.extra_headers(), net::LOAD_NORMAL,
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,
is_history_navigation_in_new_child,
@@ -612,8 +617,8 @@ void NavigationRequest::OnStartChecksComplete(
frame_tree_node_->navigator()->GetController()->GetBrowserContext(),
base::MakeUnique<NavigationRequestInfo>(
common_params_, begin_params_, first_party_for_cookies,
- frame_tree_node_->current_origin(), frame_tree_node_->IsMainFrame(),
- parent_is_main_frame, IsSecureFrame(frame_tree_node_->parent()),
+ frame_tree_node_->IsMainFrame(), parent_is_main_frame,
+ IsSecureFrame(frame_tree_node_->parent()),
frame_tree_node_->frame_tree_node_id(), is_for_guests_only,
report_raw_headers, navigating_frame_host->GetVisibilityState()),
std::move(navigation_ui_data),
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_request_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698