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

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

Issue 1409693009: Fix leaking of RenderFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on ToT and a small change. Created 5 years 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
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 96d6c1f6d836ff6dc84fe017d5e220c0403fd812..081329719ec32be8ae2d5427c870e57e02c61e80 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -942,6 +942,16 @@ void RenderFrameHostManager::DiscardUnusedFrame(
}
if (render_frame_host) {
+ // Clean up the unused RenderFrame in the renderer process for any
+ // subframe. The main frame is going to be cleaned up by RenderViewHost
+ // deleting RenderView, unless there are other active frames.
+ if (SiteIsolationPolicy::IsSwappedOutStateForbidden() &&
+ (render_frame_host->GetSiteInstance()->active_frame_count() > 1U ||
+ !frame_tree_node_->IsMainFrame())) {
Charlie Reis 2015/12/11 00:03:17 nit: Swap the active_frame_count and IsMainFrame c
nasko 2015/12/11 00:47:25 No longer applies as the code is gone.
+ render_frame_host->Send(
+ new FrameMsg_Detach(render_frame_host->GetRoutingID()));
+ }
+
// We won't be coming back, so delete this one.
ShutdownProxiesIfLastActiveFrameInSiteInstance(render_frame_host.get());
render_frame_host.reset();
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/browser/site_per_process_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698