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

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

Issue 1894193002: Remove RenderFrameHostManager::MoveToPendingDeleteHosts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on review by alexmos@ Created 4 years, 8 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698