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

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

Issue 525583002: Fix RenderFrameHost lifetime and clean up CommitPending. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('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 077cf08b1681ac1329ccebe28055b32546e186ee..7a17f1c1041352996ae4ac2f4ea69487fe4db767 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -237,12 +237,13 @@ 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's main frame is pending shutdown for this
+ // If a RenderViewHost's main frame is pending deletion 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) {
+ RenderFrameHostImpl* main_frame = static_cast<RenderFrameHostImpl*>(
+ iter->second->GetMainFrame());
+ if (main_frame->frame_tree_node()->render_manager()->IsPendingDeletion(
+ main_frame)) {
render_view_host_pending_shutdown_map_.insert(
std::pair<int, RenderViewHostImpl*>(site_instance->GetId(),
iter->second));
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698