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

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: Handle main frame navigating to existing process. Created 5 years, 1 month 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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 // document. Check if |render_frame_host| is already swapped out, to avoid 916 // document. Check if |render_frame_host| is already swapped out, to avoid
917 // swapping it out again. 917 // swapping it out again.
918 if (!render_frame_host->is_swapped_out()) 918 if (!render_frame_host->is_swapped_out())
919 render_frame_host->SwapOut(proxy, false); 919 render_frame_host->SwapOut(proxy, false);
920 920
921 proxy->TakeFrameHostOwnership(render_frame_host.Pass()); 921 proxy->TakeFrameHostOwnership(render_frame_host.Pass());
922 } 922 }
923 } 923 }
924 924
925 if (render_frame_host) { 925 if (render_frame_host) {
926 // Clean up the unused RenderFrame in the renderer process for any
927 // subframe. The main frame is going to be cleaned up by RenderViewHost
928 // deleting RenderView, unless there are other active frames.
929 if (SiteIsolationPolicy::IsSwappedOutStateForbidden() &&
930 (render_frame_host->GetSiteInstance()->active_frame_count() > 1U ||
Charlie Reis 2015/11/04 21:28:30 Did you have a concern about this? I'm looking at
nasko 2015/12/10 21:26:52 It is coincidentally right after this - ShutdownPr
931 !frame_tree_node_->IsMainFrame())) {
932 render_frame_host->Send(
933 new FrameMsg_Detach(render_frame_host->GetRoutingID()));
934 }
935
926 // We won't be coming back, so delete this one. 936 // We won't be coming back, so delete this one.
927 ShutdownProxiesIfLastActiveFrameInSiteInstance(render_frame_host.get()); 937 ShutdownProxiesIfLastActiveFrameInSiteInstance(render_frame_host.get());
928 render_frame_host.reset(); 938 render_frame_host.reset();
929 } 939 }
930 } 940 }
931 941
932 void RenderFrameHostManager::MoveToPendingDeleteHosts( 942 void RenderFrameHostManager::MoveToPendingDeleteHosts(
933 scoped_ptr<RenderFrameHostImpl> render_frame_host) { 943 scoped_ptr<RenderFrameHostImpl> render_frame_host) {
934 // If this is the main frame going away and there are no more references to 944 // If this is the main frame going away and there are no more references to
935 // its RenderViewHost, mark it for deletion as well so that we don't try to 945 // its RenderViewHost, mark it for deletion as well so that we don't try to
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { 2692 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) {
2683 if (!frame_tree_node_->opener()) 2693 if (!frame_tree_node_->opener())
2684 return MSG_ROUTING_NONE; 2694 return MSG_ROUTING_NONE;
2685 2695
2686 return frame_tree_node_->opener() 2696 return frame_tree_node_->opener()
2687 ->render_manager() 2697 ->render_manager()
2688 ->GetRoutingIdForSiteInstance(instance); 2698 ->GetRoutingIdForSiteInstance(instance);
2689 } 2699 }
2690 2700
2691 } // namespace content 2701 } // namespace content
OLDNEW
« 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