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

Side by Side Diff: content/browser/frame_host/frame_tree.cc

Issue 902683002: Remove usage of RenderViewHost which aren't needed anymore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove static casts. Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/frame_tree.h" 5 #include "content/browser/frame_host/frame_tree.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 RenderViewHostMap::iterator iter = 292 RenderViewHostMap::iterator iter =
293 render_view_host_map_.find(site_instance->GetId()); 293 render_view_host_map_.find(site_instance->GetId());
294 // TODO(creis): Mirror the frame tree so this check can't fail. 294 // TODO(creis): Mirror the frame tree so this check can't fail.
295 if (iter == render_view_host_map_.end()) 295 if (iter == render_view_host_map_.end())
296 return NULL; 296 return NULL;
297 return iter->second; 297 return iter->second;
298 } 298 }
299 299
300 void FrameTree::RegisterRenderFrameHost( 300 void FrameTree::RegisterRenderFrameHost(
301 RenderFrameHostImpl* render_frame_host) { 301 RenderFrameHostImpl* render_frame_host) {
302 SiteInstance* site_instance = 302 SiteInstance* site_instance = render_frame_host->GetSiteInstance();
303 render_frame_host->render_view_host()->GetSiteInstance();
304 RenderViewHostMap::iterator iter = 303 RenderViewHostMap::iterator iter =
305 render_view_host_map_.find(site_instance->GetId()); 304 render_view_host_map_.find(site_instance->GetId());
306 CHECK(iter != render_view_host_map_.end()); 305 CHECK(iter != render_view_host_map_.end());
307 306
308 iter->second->increment_ref_count(); 307 iter->second->increment_ref_count();
309 } 308 }
310 309
311 void FrameTree::UnregisterRenderFrameHost( 310 void FrameTree::UnregisterRenderFrameHost(
312 RenderFrameHostImpl* render_frame_host) { 311 RenderFrameHostImpl* render_frame_host) {
313 SiteInstance* site_instance = 312 SiteInstance* site_instance = render_frame_host->GetSiteInstance();
314 render_frame_host->render_view_host()->GetSiteInstance();
315 int32 site_instance_id = site_instance->GetId(); 313 int32 site_instance_id = site_instance->GetId();
316 RenderViewHostMap::iterator iter = 314 RenderViewHostMap::iterator iter =
317 render_view_host_map_.find(site_instance_id); 315 render_view_host_map_.find(site_instance_id);
318 if (iter != render_view_host_map_.end() && 316 if (iter != render_view_host_map_.end() &&
319 iter->second == render_frame_host->render_view_host()) { 317 iter->second == render_frame_host->render_view_host()) {
320 // Decrement the refcount and shutdown the RenderViewHost if no one else is 318 // Decrement the refcount and shutdown the RenderViewHost if no one else is
321 // using it. 319 // using it.
322 CHECK_GT(iter->second->ref_count(), 0); 320 CHECK_GT(iter->second->ref_count(), 0);
323 iter->second->decrement_ref_count(); 321 iter->second->decrement_ref_count();
324 if (iter->second->ref_count() == 0) { 322 if (iter->second->ref_count() == 0) {
(...skipping 22 matching lines...) Expand all
347 rvh->Shutdown(); 345 rvh->Shutdown();
348 render_view_host_pending_shutdown_map_.erase(multi_iter); 346 render_view_host_pending_shutdown_map_.erase(multi_iter);
349 } 347 }
350 break; 348 break;
351 } 349 }
352 CHECK(render_view_host_found); 350 CHECK(render_view_host_found);
353 } 351 }
354 } 352 }
355 353
356 } // namespace content 354 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698