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

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

Issue 2226023003: Fix RenderView reuse issues after a pending RenderFrameHost dies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve conflicts Created 4 years, 4 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_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index 1a55641cb0cbc7d1dfeb60d0cfd413f12035677b..a980f46378f7ce02abc7e3aaf3bbf6e0b9d7936b 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1478,11 +1478,16 @@ void RenderFrameHostImpl::OnRenderProcessGone(int status, int exit_code) {
iter.second.Run(ui::AXTreeUpdate());
ax_tree_snapshot_callbacks_.clear();
- // If the process has died, we don't need to wait for the swap out ack from
- // this RenderFrame if it is pending deletion. Complete the swap out to
- // destroy it.
- if (!is_active())
+ if (!is_active()) {
+ // If the process has died, we don't need to wait for the swap out ack from
+ // this RenderFrame if it is pending deletion. Complete the swap out to
+ // destroy it.
OnSwappedOut();
+ } else {
+ // If this was the current pending or speculative RFH dying, cancel and
+ // destroy it.
+ frame_tree_node_->render_manager()->CancelPendingIfNecessary(this);
+ }
// Note: don't add any more code at this point in the function because
// |this| may be deleted. Any additional cleanup should happen before
@@ -2140,13 +2145,6 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
void RenderFrameHostImpl::ResetWaitingState() {
DCHECK(is_active());
- // The active state of the RVH is determined by its main frame, since
- // subframes should have their own widgets.
- if (frame_tree_node_->IsMainFrame()) {
- render_view_host_->set_is_active(true);
alexmos 2016/08/08 23:59:01 Looking at whether this might affect is_active() u
nasko 2016/08/09 18:32:32 I don't know and don't recall :(. However, bindin
alexmos 2016/08/09 23:09:46 Ah, this is probably fine then. Thanks!
- render_view_host_->set_is_swapped_out(false);
- }
-
// Whenever we reset the RFH state, we should not be waiting for beforeunload
// or close acks. We clear them here to be safe, since they can cause
// navigations to be ignored in OnDidCommitProvisionalLoad.

Powered by Google App Engine
This is Rietveld 408576698