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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2731283003: (Reland) Discard compositor frames from unloaded web content (Closed)
Patch Set: Initialize field to zero 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/renderer_host/render_widget_host_impl.h
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index b6aa99ec6f3c4147adec40a795432f45b41385ef..11dddf13c0f1ebfe7a95f53baaa4490f5c19f65c 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -325,8 +325,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
void StopHangMonitorTimeout();
// Starts the rendering timeout, which will clear displayed graphics if
- // a new compositor frame is not received before it expires.
- void StartNewContentRenderingTimeout();
+ // a new compositor frame is not received before it expires. This also causes
+ // any new compositor frames received with content_source_id less than
+ // |next_source_id| to be discarded.
+ void StartNewContentRenderingTimeout(uint32_t next_source_id);
// Notification that a new compositor frame has been generated following
// a page load. This stops |new_content_rendering_timeout_|, or prevents
@@ -889,6 +891,14 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
// renderer process before clearing any previously displayed content.
base::TimeDelta new_content_rendering_delay_;
+ // This identifier tags compositor frames according to the page load with
+ // which they are associated, to prevent an unloaded web page from being
+ // drawn after a navigation to a new page has already committed. This is
+ // a no-op for non-top-level RenderWidgets, as that should always be zero.
+ // TODO(kenrb, fsamuel): We should use SurfaceIDs for this purpose when they
+ // are available in the renderer process. See https://crbug.com/695579.
+ uint32_t current_content_source_id_;
+
#if defined(OS_MACOSX)
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
#endif
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698