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

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

Issue 1074843002: Fix RenderFrameProxyHost leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lucasfix
Patch Set: Self-review fixes. Created 5 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
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 d027c064898359a83bad4a416df305e5c956f3bd..f19fe90633e703704c7cdc1bc39a2844a4fc747f 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -608,13 +608,13 @@ void RenderFrameHostManager::SwapOutOldFrame(
size_t active_frame_count =
old_render_frame_host->GetSiteInstance()->active_frame_count();
if (active_frame_count <= 1) {
+ // Clear out any proxies from this SiteInstance, in case this was the
+ // last one keeping other proxies alive.
+ ShutdownProxiesIfLastActiveFrameInSiteInstance(old_render_frame_host.get());
+
// Tell the old RenderFrameHost to swap out, with no proxy to replace it.
old_render_frame_host->SwapOut(NULL, true);
MoveToPendingDeleteHosts(old_render_frame_host.Pass());
-
- // Also clear out any proxies from this SiteInstance, in case this was the
- // last one keeping other proxies alive.
- ShutdownProxiesIfLastActiveFrameInSiteInstance(old_render_frame_host.get());
return;
}

Powered by Google App Engine
This is Rietveld 408576698