| 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 baefe87ff15bb16c12ee8ea585baedb23b800296..f7f938836f33c10e1ac46a3a2fa20023025fda60 100644
|
| --- a/content/browser/frame_host/render_frame_host_manager.cc
|
| +++ b/content/browser/frame_host/render_frame_host_manager.cc
|
| @@ -694,17 +694,6 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
|
| CleanUpNavigation();
|
| navigation_rfh = render_frame_host_.get();
|
| } else {
|
| - // If the current render_frame_host_ isn't live, we should create it so
|
| - // that we don't show a sad tab while the navigation is ongoing.
|
| - // (Bug 1145340)
|
| - if (!render_frame_host_->IsRenderFrameLive()) {
|
| - // Note: we don't call InitRenderView here because we are navigating away
|
| - // soon anyway, and we don't have the NavigationEntry for this host.
|
| - delegate_->CreateRenderViewForRenderManager(
|
| - render_frame_host_->render_view_host(), MSG_ROUTING_NONE,
|
| - MSG_ROUTING_NONE, frame_tree_node_->IsMainFrame());
|
| - }
|
| -
|
| // If the SiteInstance for the final URL doesn't match the one from the
|
| // speculatively created RenderFrameHost, create a new RenderFrameHost using
|
| // this new SiteInstance.
|
| @@ -719,6 +708,16 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
|
| }
|
| DCHECK(speculative_render_frame_host_);
|
| navigation_rfh = speculative_render_frame_host_.get();
|
| +
|
| + // Check if our current RFH is live.
|
| + if (!render_frame_host_->IsRenderFrameLive()) {
|
| + // The current RFH is not live. There's no reason to sit around with a
|
| + // sad tab or a newly created RFH while we wait for the navigation to
|
| + // complete. Just switch to the speculative RFH now and go back to non
|
| + // cross-navigating (Note that we don't care about on{before}unload
|
| + // handlers if the current RFH isn't live.)
|
| + CommitPending();
|
| + }
|
| }
|
| DCHECK(navigation_rfh &&
|
| (navigation_rfh == render_frame_host_.get() ||
|
|
|