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

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

Issue 2720763002: PlzNavigate: preserve SourceLocation when navigating (Closed)
Patch Set: Fix rebase compilation issues Created 3 years, 9 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 a33257a2be0021c7f87e2d57a107efce9a67a78a..9aa4406c4f83800cacb89b7d32f63b5120ec4963 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -526,14 +526,20 @@ void NavigationRequest::OnResponseStarted(
}
DCHECK(render_frame_host || !response_should_be_rendered_);
- // For renderer-initiated navigations that are set to commit in a different
- // renderer, allow the embedder to cancel the transfer.
if (!browser_initiated_ && render_frame_host &&
- render_frame_host != frame_tree_node_->current_frame_host() &&
- !frame_tree_node_->navigator()->GetDelegate()->ShouldTransferNavigation(
- frame_tree_node_->IsMainFrame())) {
- frame_tree_node_->ResetNavigationRequest(false);
- return;
+ render_frame_host != frame_tree_node_->current_frame_host()) {
+ // Reset the source location information if the navigation will not commit
+ // in the current renderer process. This information originated in another
+ // process (the current one), it should not be transferred to the new one.
+ common_params_.source_location.reset();
+
+ // Allow the embedder to cancel the cross-process commit if needed.
+ // TODO(clamy): Rename ShouldTransferNavigation once PlzNavigate ships.
+ if (!frame_tree_node_->navigator()->GetDelegate()->ShouldTransferNavigation(
+ frame_tree_node_->IsMainFrame())) {
+ frame_tree_node_->ResetNavigationRequest(false);
+ return;
+ }
}
if (navigation_data)
« no previous file with comments | « content/browser/frame_host/navigation_entry_impl.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698