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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 // document. Check if |render_frame_host| is already swapped out, to avoid 935 // document. Check if |render_frame_host| is already swapped out, to avoid
936 // swapping it out again. 936 // swapping it out again.
937 if (!render_frame_host->is_swapped_out()) 937 if (!render_frame_host->is_swapped_out())
938 render_frame_host->SwapOut(proxy, false); 938 render_frame_host->SwapOut(proxy, false);
939 939
940 proxy->TakeFrameHostOwnership(render_frame_host.Pass()); 940 proxy->TakeFrameHostOwnership(render_frame_host.Pass());
941 } 941 }
942 } 942 }
943 943
944 if (render_frame_host) { 944 if (render_frame_host) {
945 // Clean up the unused RenderFrame in the renderer process for any
946 // subframe. The main frame is going to be cleaned up by RenderViewHost
947 // deleting RenderView, unless there are other active frames.
948 if (SiteIsolationPolicy::IsSwappedOutStateForbidden() &&
949 (render_frame_host->GetSiteInstance()->active_frame_count() > 1U ||
950 !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.
951 render_frame_host->Send(
952 new FrameMsg_Detach(render_frame_host->GetRoutingID()));
953 }
954
945 // We won't be coming back, so delete this one. 955 // We won't be coming back, so delete this one.
946 ShutdownProxiesIfLastActiveFrameInSiteInstance(render_frame_host.get()); 956 ShutdownProxiesIfLastActiveFrameInSiteInstance(render_frame_host.get());
947 render_frame_host.reset(); 957 render_frame_host.reset();
948 } 958 }
949 } 959 }
950 960
951 void RenderFrameHostManager::MoveToPendingDeleteHosts( 961 void RenderFrameHostManager::MoveToPendingDeleteHosts(
952 scoped_ptr<RenderFrameHostImpl> render_frame_host) { 962 scoped_ptr<RenderFrameHostImpl> render_frame_host) {
953 // If this is the main frame going away and there are no more references to 963 // If this is the main frame going away and there are no more references to
954 // its RenderViewHost, mark it for deletion as well so that we don't try to 964 // its RenderViewHost, mark it for deletion as well so that we don't try to
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { 2693 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
2684 if (!frame_tree_node_->opener()) 2694 if (!frame_tree_node_->opener())
2685 return MSG_ROUTING_NONE; 2695 return MSG_ROUTING_NONE;
2686 2696
2687 return frame_tree_node_->opener() 2697 return frame_tree_node_->opener()
2688 ->render_manager() 2698 ->render_manager()
2689 ->GetRoutingIdForSiteInstance(instance); 2699 ->GetRoutingIdForSiteInstance(instance);
2690 } 2700 }
2691 2701
2692 } // namespace content 2702 } // namespace content
OLDNEW
« 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