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

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: 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..a6f71f32950ecd7398ef5f9170a059f4f6dffee8 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -651,9 +651,12 @@ void RenderFrameHostManager::SwapOutOldFrame(
// RenderFrameHost once it runs its unload handler, without replacing it with
// a proxy.
if (old_render_frame_host->GetSiteInstance()->active_frame_count() <= 1) {
- // Tell the old RenderFrameHost to swap out, with no proxy to replace it.
+ // Tell the old RenderFrameHost to swap out, with no proxy to replace it and
+ // put it on the pending deletion list. It 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).
old_render_frame_host->SwapOut(nullptr, true);
- MoveToPendingDeleteHosts(std::move(old_render_frame_host));
+ pending_delete_hosts_.push_back(std::move(old_render_frame_host));
return;
}
@@ -669,7 +672,10 @@ void RenderFrameHostManager::SwapOutOldFrame(
// 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));
alexmos 2016/04/18 20:48:05 nit: instead of repeating the comment, I'm curious
nasko 2016/04/18 22:00:16 Good idea! Done.
}
void RenderFrameHostManager::DiscardUnusedFrame(
@@ -701,14 +707,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