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

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

Issue 1772393002: Frames received after guest detaches should be displayed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary variable. 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_widget_host_view_guest.cc
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc
index 66ef61369b3a1f3093b8604118eecaeeb5508bd3..2d560c1752d38b658e36d1c1973a96e216a92188 100644
--- a/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -207,12 +207,6 @@ void RenderWidgetHostViewGuest::SetTooltipText(
void RenderWidgetHostViewGuest::OnSwapCompositorFrame(
uint32_t output_surface_id,
scoped_ptr<cc::CompositorFrame> frame) {
- if (!guest_ || !guest_->attached()) {
- // We shouldn't hang on to a surface while we are detached.
- ClearCompositorSurfaceIfNecessary();
- return;
- }
-
last_scroll_offset_ = frame->metadata.root_scroll_offset;
cc::RenderPass* root_pass =
@@ -266,6 +260,12 @@ void RenderWidgetHostViewGuest::OnSwapCompositorFrame(
ack_callback);
ProcessFrameSwappedCallbacks();
+
+ // If after detaching we are sent a frame, we should finish processing it, and
+ // then we should clear the surface so that we are not holding resources we
+ // no longer need.
+ if (!guest_ || !guest_->attached())
+ ClearCompositorSurfaceIfNecessary();
}
bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698