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..005fab22540a0cfb8061f9ea389995a0efe31837 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); |
@@ -716,6 +713,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost, |
void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); |
+ void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, |
+ cc::CompositorFrame frame); |
+ |
// 1. Grants permissions to URL (if any) |
// 2. Grants permissions to filenames |
// 3. Grants permissions to file system files. |
@@ -929,10 +929,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); |