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

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

Issue 1157563002: Revert of Add ref-count on RenderViewHost for each new RenderFrameProxyHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « content/browser/frame_host/frame_tree.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/frame_host/frame_tree.h ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698