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 7eee0fb8435478bc8421d0656512c4de7722df77..52c7365b325c17712be0558a92540ef789b1f41b 100644 |
--- a/content/browser/renderer_host/render_widget_host_impl.h |
+++ b/content/browser/renderer_host/render_widget_host_impl.h |
@@ -25,7 +25,6 @@ |
#include "base/time/time.h" |
#include "base/timer/elapsed_timer.h" |
#include "build/build_config.h" |
-#include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
#include "cc/resources/shared_bitmap.h" |
#include "cc/surfaces/frame_sink_id.h" |
#include "content/browser/renderer_host/event_with_latency_info.h" |
@@ -44,7 +43,6 @@ |
#include "content/public/common/page_zoom.h" |
#include "content/public/common/url_constants.h" |
#include "ipc/ipc_listener.h" |
-#include "mojo/public/cpp/bindings/binding.h" |
#include "third_party/WebKit/public/platform/WebDisplayMode.h" |
#include "ui/base/ime/text_input_mode.h" |
#include "ui/base/ime/text_input_type.h" |
@@ -95,13 +93,11 @@ struct TextInputState; |
// This implements the RenderWidgetHost interface that is exposed to |
// embedders of content, and adds things only visible to content. |
-class CONTENT_EXPORT RenderWidgetHostImpl |
- : public RenderWidgetHost, |
- public InputRouterClient, |
- public InputAckHandler, |
- public TouchEmulatorClient, |
- public NON_EXPORTED_BASE(cc::mojom::MojoCompositorFrameSink), |
- public IPC::Listener { |
+class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost, |
+ public InputRouterClient, |
+ public InputAckHandler, |
+ public TouchEmulatorClient, |
+ public IPC::Listener { |
public: |
// |routing_id| must not be MSG_ROUTING_NONE. |
// If this object outlives |delegate|, DetachDelegate() must be called when |
@@ -458,6 +454,11 @@ class CONTENT_EXPORT RenderWidgetHostImpl |
// locked. |
bool GotResponseToLockMouseRequest(bool allowed); |
+ // Called by the view in response to OnSwapCompositorFrame. |
+ void SendReclaimCompositorResources( |
+ bool is_swap_ack, |
+ const cc::ReturnedResourceArray& resources); |
+ |
void set_allow_privileged_mouse_lock(bool allow) { |
allow_privileged_mouse_lock_ = allow; |
} |
@@ -572,21 +573,14 @@ class CONTENT_EXPORT RenderWidgetHostImpl |
// renderer unless it is for an immediate request. |
void RequestCompositionUpdates(bool immediate_request, bool monitor_updates); |
- void RequestMojoCompositorFrameSink( |
- cc::mojom::MojoCompositorFrameSinkRequest request, |
- cc::mojom::MojoCompositorFrameSinkClientPtr client); |
+ // Submits the frame received from RenderWidget. |
+ void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, |
+ cc::CompositorFrame frame); |
const cc::CompositorFrameMetadata& last_frame_metadata() { |
return last_frame_metadata_; |
} |
- // cc::mojom::MojoCompositorFrameSink implementation. |
- void SetNeedsBeginFrame(bool needs_begin_frame) override; |
- void SubmitCompositorFrame(const cc::LocalSurfaceId& local_surface_id, |
- cc::CompositorFrame frame) override; |
- void BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) override; |
- void EvictFrame() override {} |
- |
protected: |
// --------------------------------------------------------------------------- |
// The following method is overridden by RenderViewHost to send upwards to |
@@ -645,6 +639,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl |
void OnRequestMove(const gfx::Rect& pos); |
void OnSetTooltipText(const base::string16& tooltip_text, |
blink::WebTextDirection text_direction_hint); |
+ bool OnSwapCompositorFrame(const IPC::Message& message); |
void OnBeginFrameDidNotSwap(const cc::BeginFrameAck& ack); |
void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); |
@@ -966,9 +961,10 @@ class CONTENT_EXPORT RenderWidgetHostImpl |
gfx::Size last_frame_size_; |
float last_device_scale_factor_; |
- mojo::Binding<cc::mojom::MojoCompositorFrameSink> |
- compositor_frame_sink_binding_; |
- cc::mojom::MojoCompositorFrameSinkClientPtr renderer_compositor_frame_sink_; |
+ // 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; |
cc::CompositorFrameMetadata last_frame_metadata_; |