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 191a94ee3e78a80680e3751d1f677e07dc0003cc..ff30a685500886882897317a205c7a38200e1fbd 100644 |
--- a/content/browser/frame_host/render_frame_host_manager.cc |
+++ b/content/browser/frame_host/render_frame_host_manager.cc |
@@ -653,23 +653,24 @@ void RenderFrameHostManager::SwapOutOldFrame( |
if (old_render_frame_host->GetSiteInstance()->active_frame_count() <= 1) { |
// Tell the old RenderFrameHost to swap out, with no proxy to replace it. |
old_render_frame_host->SwapOut(nullptr, true); |
- MoveToPendingDeleteHosts(std::move(old_render_frame_host)); |
- return; |
- } |
- |
- // Otherwise there are active views and we need a proxy for the old RFH. |
- // (There should not be one yet.) |
- RenderFrameProxyHost* proxy = |
- CreateRenderFrameProxyHost(old_render_frame_host->GetSiteInstance(), |
- old_render_frame_host->render_view_host()); |
+ } else { |
+ // Otherwise there are active views and we need a proxy for the old RFH. |
+ // (There should not be one yet.) |
+ RenderFrameProxyHost* proxy = |
+ CreateRenderFrameProxyHost(old_render_frame_host->GetSiteInstance(), |
+ old_render_frame_host->render_view_host()); |
- // Tell the old RenderFrameHost to swap out and be replaced by the proxy. |
- old_render_frame_host->SwapOut(proxy, true); |
+ // Tell the old RenderFrameHost to swap out and be replaced by the proxy. |
+ old_render_frame_host->SwapOut(proxy, true); |
- // SwapOut creates a RenderFrameProxy, so set the proxy to be initialized. |
- proxy->set_render_frame_proxy_created(true); |
+ // SwapOut creates a RenderFrameProxy, so set the proxy to be initialized. |
+ proxy->set_render_frame_proxy_created(true); |
+ } |
- MoveToPendingDeleteHosts(std::move(old_render_frame_host)); |
+ // |old_render_frame_host| will be deleted when its SwapOut ACK is received, |
+ // or when the timer times out, or when the RFHM itself is deleted (whichever |
+ // comes first). |
+ pending_delete_hosts_.push_back(std::move(old_render_frame_host)); |
} |
void RenderFrameHostManager::DiscardUnusedFrame( |
@@ -701,14 +702,6 @@ void RenderFrameHostManager::DiscardUnusedFrame( |
render_frame_host.reset(); |
} |
-void RenderFrameHostManager::MoveToPendingDeleteHosts( |
- std::unique_ptr<RenderFrameHostImpl> render_frame_host) { |
- // |render_frame_host| will be deleted when its SwapOut ACK is received, or |
- // when the timer times out, or when the RFHM itself is deleted (whichever |
- // comes first). |
- pending_delete_hosts_.push_back(std::move(render_frame_host)); |
-} |
- |
bool RenderFrameHostManager::IsViewPendingDeletion( |
RenderViewHostImpl* render_view_host) { |
// Only safe to call this on the main frame. |