Index: content/browser/frame_host/frame_tree.cc |
diff --git a/content/browser/frame_host/frame_tree.cc b/content/browser/frame_host/frame_tree.cc |
index eb44be67c5ce97d8bcc41c4e3f32492b679ef917..798a849daf40ee39ab32d5772c4e7626188bcb41 100644 |
--- a/content/browser/frame_host/frame_tree.cc |
+++ b/content/browser/frame_host/frame_tree.cc |
@@ -299,24 +299,24 @@ |
return iter->second; |
} |
-void FrameTree::AddRenderViewHostRef( |
- RenderViewHostImpl* render_view_host) { |
- SiteInstance* site_instance = render_view_host->GetSiteInstance(); |
+void FrameTree::RegisterRenderFrameHost( |
+ RenderFrameHostImpl* render_frame_host) { |
+ SiteInstance* site_instance = render_frame_host->GetSiteInstance(); |
RenderViewHostMap::iterator iter = |
render_view_host_map_.find(site_instance->GetId()); |
CHECK(iter != render_view_host_map_.end()); |
- CHECK(iter->second == render_view_host); |
iter->second->increment_ref_count(); |
} |
-void FrameTree::ReleaseRenderViewHostRef( |
- RenderViewHostImpl* render_view_host) { |
- SiteInstance* site_instance = render_view_host->GetSiteInstance(); |
+void FrameTree::UnregisterRenderFrameHost( |
+ RenderFrameHostImpl* render_frame_host) { |
+ SiteInstance* site_instance = render_frame_host->GetSiteInstance(); |
int32 site_instance_id = site_instance->GetId(); |
RenderViewHostMap::iterator iter = |
render_view_host_map_.find(site_instance_id); |
- if (iter != render_view_host_map_.end() && iter->second == render_view_host) { |
+ if (iter != render_view_host_map_.end() && |
+ iter->second == render_frame_host->render_view_host()) { |
// Decrement the refcount and shutdown the RenderViewHost if no one else is |
// using it. |
CHECK_GT(iter->second->ref_count(), 0); |
@@ -335,15 +335,16 @@ |
for (RenderViewHostMultiMap::iterator multi_iter = result.first; |
multi_iter != result.second; |
++multi_iter) { |
- if (multi_iter->second != render_view_host) |
+ if (multi_iter->second != render_frame_host->render_view_host()) |
continue; |
render_view_host_found = true; |
+ RenderViewHostImpl* rvh = multi_iter->second; |
// Decrement the refcount and shutdown the RenderViewHost if no one else |
// is using it. |
- CHECK_GT(render_view_host->ref_count(), 0); |
- render_view_host->decrement_ref_count(); |
- if (render_view_host->ref_count() == 0) { |
- render_view_host->Shutdown(); |
+ CHECK_GT(rvh->ref_count(), 0); |
+ rvh->decrement_ref_count(); |
+ if (rvh->ref_count() == 0) { |
+ rvh->Shutdown(); |
render_view_host_pending_shutdown_map_.erase(multi_iter); |
} |
break; |