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

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

Issue 2383773002: Prevent RFH from attempting to transfer after it's been swapped out (Closed)
Patch Set: Created 4 years, 3 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_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 824063f5578537866e17c5e92f9baa0695283deb..a461a527235510150b912ef22f442b6eec85fbef 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -665,6 +665,14 @@ bool NavigationHandleImpl::MaybeTransferAndProceedInternal() {
RenderFrameHostManager* manager =
render_frame_host_->frame_tree_node()->render_manager();
+ // It is possible for the RenderFrameHost to have been marked as pending
+ // deletion following the commit of another ongoing navigation. In that case,
+ // don't attempt to transfer, but don't resume the navigation either.
+ if (render_frame_host_ != manager->current_frame_host() &&
Charlie Reis 2016/09/30 20:25:26 We used to use is_active() for this (in OnCrossSit
clamy 2016/10/04 11:54:41 Acknowledged.
+ render_frame_host_ != manager->pending_frame_host()) {
+ return false;
clamy 2016/09/30 14:06:15 This will just suspend the navigation. Alternative
Charlie Reis 2016/09/30 20:25:26 We definitely want to cancel the navigation. The
nasko 2016/09/30 23:21:33 +1 on cancelling the navigation. Keeping it suspen
clamy 2016/10/04 11:54:41 Done. The cancellation if the NavigationHandle isn
+ }
+
// In the site-per-process model, the RenderFrameHostManager may also decide
// (independently from the content embedder's ShouldSwapProcessesForRedirect
// above) that a process transfer is needed. Process transfers are skipped for
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/public/test/browser_test_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698