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

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

Issue 2774373002: Use MojoCompositorFrameSink in RendererCompositorFrameSink (Closed)
Patch Set: Rebased, dedup IPC Created 3 years, 8 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 c6c682fa6e90c08649c1d8bf22a845ae0c4683ce..365950b6aaa78f06034d676626da7b780994c509 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -25,6 +25,7 @@
#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"
@@ -43,6 +44,7 @@
#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"
@@ -93,11 +95,13 @@ 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 IPC::Listener {
+class CONTENT_EXPORT RenderWidgetHostImpl
+ : public RenderWidgetHost,
+ public InputRouterClient,
+ public InputAckHandler,
+ public TouchEmulatorClient,
+ public NON_EXPORTED_BASE(cc::mojom::MojoCompositorFrameSink),
+ public IPC::Listener {
public:
// |routing_id| must not be MSG_ROUTING_NONE.
// If this object outlives |delegate|, DetachDelegate() must be called when
@@ -453,11 +457,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
// 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,14 +571,21 @@ 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);
+ void RequestMojoCompositorFrameSink(
+ cc::mojom::MojoCompositorFrameSinkRequest request,
+ cc::mojom::MojoCompositorFrameSinkClientPtr client);
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
@@ -638,7 +644,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
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);
@@ -958,10 +963,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
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;
+ mojo::Binding<cc::mojom::MojoCompositorFrameSink>
+ compositor_frame_sink_binding_;
+ cc::mojom::MojoCompositorFrameSinkClientPtr renderer_compositor_frame_sink_;
cc::CompositorFrameMetadata last_frame_metadata_;
« no previous file with comments | « content/browser/renderer_host/render_process_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