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

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

Issue 2798673002: Revert "Destroy the old RenderWidgetHostView when swapping out a main frame." (Closed)
Patch Set: Created 3 years, 8 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 419beed88c1937019e7c92813296f66cb8269458..e3c237187f2271dc1371e9218fc03170b363fb92 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1395,6 +1395,8 @@ void RenderFrameHostImpl::SwapOut(
// TODO(nasko): If the frame is not live, the RFH should just be deleted by
// simulating the receipt of swap out ack.
is_waiting_for_swapout_ack_ = true;
+ if (frame_tree_node_->IsMainFrame())
+ render_view_host_->set_is_active(false);
}
void RenderFrameHostImpl::OnBeforeUnloadACK(
@@ -1563,6 +1565,13 @@ void RenderFrameHostImpl::OnSwappedOut() {
ClearAllWebUI();
+ // If this is a main frame RFH that's about to be deleted, update its RVH's
+ // swapped-out state here. https://crbug.com/505887
+ if (frame_tree_node_->IsMainFrame()) {
+ render_view_host_->set_is_active(false);
+ render_view_host_->set_is_swapped_out(true);
+ }
+
bool deleted =
frame_tree_node_->render_manager()->DeleteFromPendingList(this);
CHECK(deleted);
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698