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

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

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Improved comments Created 3 years, 10 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 8d83000306a4d24a77fd36aae39cc14c6f334a09..1660712d3174cd30fc5399c25432a8a7974c81d2 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -331,8 +331,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
@@ -895,6 +897,15 @@ 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
+ // be 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
enne (OOO) 2017/02/28 19:02:23 Yeah, having renderers know the surface id they're
+ // 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

Powered by Google App Engine
This is Rietveld 408576698