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 2786443003: Revert "Destroy the old RenderWidgetHostView when swapping out a main frame." (Closed)
Patch Set: Created 3 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
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 c8ac01409dfab33b07d12d4e8821060286f0e366..3e056615620e66237a005da0db062c7daa35c54d 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1492,6 +1492,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(
@@ -1659,6 +1661,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