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

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

Issue 606113005: Move RenderViewHost swap out state to RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review suggestions Created 6 years, 3 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
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 3415e46780ea6f1145fe1968a2f107a6f842be5c..077cf08b1681ac1329ccebe28055b32546e186ee 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -237,11 +237,12 @@ RenderViewHostImpl* FrameTree::CreateRenderViewHost(SiteInstance* site_instance,
RenderViewHostMap::iterator iter =
render_view_host_map_.find(site_instance->GetId());
if (iter != render_view_host_map_.end()) {
- // If a RenderViewHost is pending shutdown for this |site_instance|, put it
- // in the map of RenderViewHosts pending shutdown. Otherwise return the
- // existing RenderViewHost for the SiteInstance.
- if (iter->second->rvh_state() ==
- RenderViewHostImpl::STATE_PENDING_SHUTDOWN) {
+ // If a RenderViewHost's main frame is pending shutdown for this
+ // |site_instance|, put it in the map of RenderViewHosts pending shutdown.
+ // Otherwise return the existing RenderViewHost for the SiteInstance.
+ RenderFrameHost* main_frame = iter->second->GetMainFrame();
+ if (static_cast<RenderFrameHostImpl*>(main_frame)->rfh_state() ==
+ RenderFrameHostImpl::STATE_PENDING_SHUTDOWN) {
render_view_host_pending_shutdown_map_.insert(
std::pair<int, RenderViewHostImpl*>(site_instance->GetId(),
iter->second));
« no previous file with comments | « chrome/test/base/browser_with_test_window_test.cc ('k') | content/browser/frame_host/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698