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

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

Issue 464593003: Don't swap out the old RenderFrameHost until the new one commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase past PlzNavigate CL Created 6 years, 4 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/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 7b804bca2ea1d38f6213268a4d532646e5af3aa7..b64af9abe8acce4fd5dfc61a78a21e329e54b82d 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -381,7 +381,21 @@ bool NavigatorImpl::NavigateToEntry(
delegate_->AboutToNavigateRenderFrame(dest_render_frame_host);
// Navigate in the desired RenderFrameHost.
- dest_render_frame_host->Navigate(navigate_params);
+ // We can skip this step in the rare case that this is a transfer navigation
+ // which began in the chosen RenderFrameHost, since the request has already
+ // been issued. In that case, simply resume the response.
+ bool is_transfer_to_same =
+ navigate_params.transferred_request_child_id != -1 &&
+ navigate_params.transferred_request_child_id ==
+ dest_render_frame_host->GetProcess()->GetID();
+ if (!is_transfer_to_same) {
+ dest_render_frame_host->Navigate(navigate_params);
+ } else {
+ // No need to navigate again. Just resume the deferred request.
+ dest_render_frame_host->GetProcess()->ResumeDeferredNavigation(
+ GlobalRequestID(navigate_params.transferred_request_child_id,
+ navigate_params.transferred_request_request_id));
+ }
// Make sure no code called via RFH::Navigate clears the pending entry.
CHECK_EQ(controller_->GetPendingEntry(), &entry);
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_unittest.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698