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

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

Issue 1345353003: Fix detection of RenderViewHosts pending deletion in CreateRenderViewHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test timeout on Mac Created 5 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/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 71ec817e8d78b47bf48cc58b0cf878138f5921cd..872b66eb74df7992a16cfcb8603f4ddc3c5c9464 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -903,6 +903,11 @@ void RenderFrameHostManager::DiscardUnusedFrame(
void RenderFrameHostManager::MoveToPendingDeleteHosts(
scoped_ptr<RenderFrameHostImpl> render_frame_host) {
+ // If this is the main frame going away, mark the corresponding
+ // RenderViewHost for deletion as well so that we don't try to reuse it.
+ if (render_frame_host->frame_tree_node()->IsMainFrame())
+ render_frame_host->render_view_host()->set_pending_deletion();
+
// |render_frame_host| will be deleted when its SwapOut ACK is received, or
// when the timer times out, or when the RFHM itself is deleted (whichever
// comes first).
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698