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

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

Issue 1835833002: Fix 3 crashes related to navigations after a process dies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from review Created 4 years, 9 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 c3f130125c73748b721e94018d4acd2cce0c0426..fcc1c8f0157050b40b7f770e8df13d6d4813847b 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -355,7 +355,7 @@ RenderViewHostImpl* FrameTree::CreateRenderViewHost(
// SiteInstance. Note that if swapped-out is forbidden, the
// RenderViewHost's main frame has already been cleared, so we cannot rely
// on checking whether the main frame is pending deletion.
- if (iter->second->is_pending_deletion()) {
+ if (root_->render_manager()->IsViewPendingDeletion(iter->second)) {
render_view_host_pending_shutdown_map_.insert(
std::make_pair(site_instance->GetId(), iter->second));
render_view_host_map_.erase(iter);
@@ -375,9 +375,12 @@ RenderViewHostImpl* FrameTree::CreateRenderViewHost(
RenderViewHostImpl* FrameTree::GetRenderViewHost(SiteInstance* site_instance) {
RenderViewHostMap::iterator iter =
render_view_host_map_.find(site_instance->GetId());
- if (iter == render_view_host_map_.end())
- return nullptr;
- return iter->second;
+ // Don't return the RVH if it is pending deletion.
+ if (iter != render_view_host_map_.end() &&
+ !root_->render_manager()->IsViewPendingDeletion(iter->second)) {
+ return iter->second;
+ }
+ return nullptr;
}
void FrameTree::AddRenderViewHostRef(RenderViewHostImpl* render_view_host) {
« 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