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

Side by Side 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, 2 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
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 RenderViewHostImpl* FrameTree::CreateRenderViewHost(SiteInstance* site_instance, 231 RenderViewHostImpl* FrameTree::CreateRenderViewHost(SiteInstance* site_instance,
232 int routing_id, 232 int routing_id,
233 int main_frame_routing_id, 233 int main_frame_routing_id,
234 bool swapped_out, 234 bool swapped_out,
235 bool hidden) { 235 bool hidden) {
236 DCHECK(main_frame_routing_id != MSG_ROUTING_NONE); 236 DCHECK(main_frame_routing_id != MSG_ROUTING_NONE);
237 RenderViewHostMap::iterator iter = 237 RenderViewHostMap::iterator iter =
238 render_view_host_map_.find(site_instance->GetId()); 238 render_view_host_map_.find(site_instance->GetId());
239 if (iter != render_view_host_map_.end()) { 239 if (iter != render_view_host_map_.end()) {
240 // If a RenderViewHost is pending shutdown for this |site_instance|, put it 240 // If a RenderViewHost's main frame is pending shutdown for this
241 // in the map of RenderViewHosts pending shutdown. Otherwise return the 241 // |site_instance|, put it in the map of RenderViewHosts pending shutdown.
242 // existing RenderViewHost for the SiteInstance. 242 // Otherwise return the existing RenderViewHost for the SiteInstance.
243 if (iter->second->rvh_state() == 243 RenderFrameHost* main_frame = iter->second->GetMainFrame();
244 RenderViewHostImpl::STATE_PENDING_SHUTDOWN) { 244 if (static_cast<RenderFrameHostImpl*>(main_frame)->rfh_state() ==
245 RenderFrameHostImpl::STATE_PENDING_SHUTDOWN) {
245 render_view_host_pending_shutdown_map_.insert( 246 render_view_host_pending_shutdown_map_.insert(
246 std::pair<int, RenderViewHostImpl*>(site_instance->GetId(), 247 std::pair<int, RenderViewHostImpl*>(site_instance->GetId(),
247 iter->second)); 248 iter->second));
248 render_view_host_map_.erase(iter); 249 render_view_host_map_.erase(iter);
249 } else { 250 } else {
250 return iter->second; 251 return iter->second;
251 } 252 }
252 } 253 }
253 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( 254 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
254 RenderViewHostFactory::Create(site_instance, 255 RenderViewHostFactory::Create(site_instance,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 rvh->Shutdown(); 323 rvh->Shutdown();
323 render_view_host_pending_shutdown_map_.erase(multi_iter); 324 render_view_host_pending_shutdown_map_.erase(multi_iter);
324 } 325 }
325 break; 326 break;
326 } 327 }
327 CHECK(render_view_host_found); 328 CHECK(render_view_host_found);
328 } 329 }
329 } 330 }
330 331
331 } // namespace content 332 } // namespace content
OLDNEW
« 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