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

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

Issue 1832913002: PlzNavigate: allow the embedder to cancel a transferring navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@content-browsertests-2
Patch Set: Rebase Created 4 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
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('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 7e2fad9b1f1ad11978c2232864b33f889ff70e02..1afe15adbda68131817aa9afbb9b483dacc58de3 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -311,6 +311,17 @@ void NavigationRequest::OnResponseStarted(
NavigatorImpl::CheckWebUIRendererDoesNotDisplayNormalURL(render_frame_host,
common_params_.url);
+ // 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 != frame_tree_node_->current_frame_host() &&
+ !frame_tree_node_->navigator()
+ ->GetDelegate()
+ ->ShouldTransferNavigation()) {
+ frame_tree_node_->ResetNavigationRequest(false);
+ return;
+ }
+
// Store the response and the StreamHandle until checks have been processed.
response_ = response;
body_ = std::move(body);
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698