Index: content/browser/frame_host/render_frame_host_manager.cc |
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc |
index 4d326a509abffdeb4a9a503622bab2c2560818b4..791eb89285c912ad392802815b6a6b94c6214be6 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -467,10 +467,14 @@ void RenderFrameHostManager::DidNavigateFrame( |
// The pending cross-site navigation completed, so show the renderer. |
// If it committed without sending network requests (e.g., data URLs), |
// then we still need to swap out the old RFH first and run its unload |
- // handler. OK for that to happen in the background. |
+ // handler, only if it hasn't happened yet. OK for that to happen in the |
+ // background. |
if (pending_render_frame_host_->render_view_host()-> |
- HasPendingCrossSiteRequest()) |
+ HasPendingCrossSiteRequest() && |
+ pending_render_frame_host_->render_view_host()->rvh_state() == |
+ RenderViewHostImpl::STATE_DEFAULT) { |
SwapOutOldPage(); |
+ } |
CommitPending(); |
cross_navigation_pending_ = false; |