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

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

Issue 2780713004: Hide compositor_frame_sink_id from RenderWidgetHostView* (Closed)
Patch Set: Added a comment in android 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 3cefbd833b01826378c28061884c958205b22eaf..b82f30b950fde41e504b124d8c8f22c73739eac3 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -455,10 +455,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
bool GotResponseToLockMouseRequest(bool allowed);
// Called by the view in response to OnSwapCompositorFrame.
- static void SendReclaimCompositorResources(
- int32_t route_id,
- uint32_t compositor_frame_sink_id,
- int renderer_host_id,
+ void SendReclaimCompositorResources(
bool is_swap_ack,
const cc::ReturnedResourceArray& resources);
@@ -577,6 +574,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
// renderer unless it is for an immediate request.
void RequestCompositionUpdates(bool immediate_request, bool monitor_updates);
+ // Submits the frame received from RenderWidget.
+ void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id,
+ cc::CompositorFrame frame);
+
protected:
// ---------------------------------------------------------------------------
// The following method is overridden by RenderViewHost to send upwards to
@@ -929,10 +930,18 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_;
#endif
+ // These information are used to verify that the renderer does not misbehave
+ // when it comes to allocating LocalSurfaceIds. If frame size or device scale
+ // factor change, a new LocalSurfaceId must be created.
cc::LocalSurfaceId last_local_surface_id_;
gfx::Size last_frame_size_;
float last_device_scale_factor_;
+ // Each instance of RendererCompositorFrameSink has an ID that we keep track
+ // of so we can tell when a new instance has been created for the purpose of
+ // not returning stale resources.
+ uint32_t last_compositor_frame_sink_id_ = 0;
+
base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);

Powered by Google App Engine
This is Rietveld 408576698