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

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

Issue 108483008: Make RenderFrameHostManager swap RenderFrameHosts, not RenderViewHosts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 658e834230dd6fe39ee05f4891563fa7cc618f99..a2f87122fcb6dca0fab27ea5ba8285e95d8c5199 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -48,6 +48,7 @@ RenderFrameHostImpl::RenderFrameHostImpl(
frame_tree_node_(frame_tree_node),
routing_id_(routing_id),
is_swapped_out_(is_swapped_out) {
+ frame_tree_->RegisterRenderFrameHost(this);
GetProcess()->AddRoute(routing_id_, this);
g_routing_id_frame_map.Get().insert(std::make_pair(
RenderFrameHostID(GetProcess()->GetID(), routing_id_),
@@ -60,6 +61,10 @@ RenderFrameHostImpl::~RenderFrameHostImpl() {
RenderFrameHostID(GetProcess()->GetID(), routing_id_));
if (delegate_)
delegate_->RenderFrameDeleted(this);
+
+ // Notify the FrameTree that this RFH is going away, allowing it to shut down
+ // the corresponding RenderViewHost if it is no longer needed.
+ frame_tree_->UnregisterRenderFrameHost(this);
}
int RenderFrameHostImpl::GetRoutingID() {

Powered by Google App Engine
This is Rietveld 408576698