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

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

Issue 1409693009: Fix leaking of RenderFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't send IPC for the main frame. 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_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 18a88eb441030f40bbeb1fb55ee33ec8085b8d4f..5b83b2649eadfa82fd382ddb640d3f9571cdcdec 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -258,11 +258,18 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
if (delegate_ && render_frame_created_)
delegate_->RenderFrameDeleted(this);
- // If this was swapped out, it already decremented the active frame count of
- // the SiteInstance it belongs to.
- if (IsRFHStateActive(rfh_state_))
+ if (IsRFHStateActive(rfh_state_)) {
+ // If this was swapped out, it already decremented the active frame count of
+ // the SiteInstance it belongs to.
GetSiteInstance()->decrement_active_frame_count();
+ // In the case of swapping with a RenderFrameProxy, cleanup is already
+ // handled on the renderer process side. However, in all other cases the
+ // corresponding RenderFrame also needs to be cleaned up.
+ if (!frame_tree_node_->IsMainFrame() && render_frame_created_)
Charlie Reis 2015/12/11 20:10:14 Hmm, this condition and the comment above seem to
nasko 2015/12/14 21:00:02 Done.
+ Send(new FrameMsg_Detach(routing_id_));
+ }
+
// NULL out the swapout timer; in crash dumps this member will be null only if
// the dtor has run.
swapout_event_monitor_timeout_.reset();
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | content/renderer/render_frame_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698