[go: nahoru, domu]

Add IPC messages to transfer compositor protos

- Be able to send and receive compositor protos to/from the render
  process and the browser process.  Messages are piped through the
  browser process to/from the network and renderer.  A separate client
  (go/blimp) will render the compositor protos.  This is part of the
  compositor refactor around splitting ThreadProxy into two components.
- Hook the proto sending into the BlimpEngineSession class.
- Set up a RemoteProtoChannel interface on the CC side to be used by the
  ChannelMain class once we start building that from the LayerTreeHost.

BUG=552055
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1442853005

Cr-Commit-Position: refs/heads/master@{#360452}
diff --git a/blimp/engine/browser/blimp_engine_session.cc b/blimp/engine/browser/blimp_engine_session.cc
index f65706a..8f2f1c44 100644
--- a/blimp/engine/browser/blimp_engine_session.cc
+++ b/blimp/engine/browser/blimp_engine_session.cc
@@ -138,7 +138,8 @@
     scoped_ptr<BlimpMessage> message,
     const net::CompletionCallback& callback) {
   DCHECK(message->type() == BlimpMessage::CONTROL ||
-         message->type() == BlimpMessage::NAVIGATION);
+      message->type() == BlimpMessage::NAVIGATION ||
+      message->type() == BlimpMessage::COMPOSITOR);
 
   if (message->type() == BlimpMessage::CONTROL) {
     switch (message->control().type()) {
@@ -233,6 +234,13 @@
   contents->GetRenderViewHost()->GetWidget()->Focus();
 }
 
+void BlimpEngineSession::ForwardCompositorProto(
+    const std::vector<uint8_t>& proto) {
+  // Send the compositor proto over the network layer to the client, which will
+  // apply the proto to their local compositor instance.
+  // TODO(dtrainor): Send the compositor proto.
+}
+
 void BlimpEngineSession::PlatformSetContents(
     scoped_ptr<content::WebContents> new_contents) {
   new_contents->SetDelegate(this);
diff --git a/blimp/engine/browser/blimp_engine_session.h b/blimp/engine/browser/blimp_engine_session.h
index 8adaef5..6b117a9 100644
--- a/blimp/engine/browser/blimp_engine_session.h
+++ b/blimp/engine/browser/blimp_engine_session.h
@@ -86,6 +86,7 @@
                           bool last_unlocked_by_target) override;
   void CloseContents(content::WebContents* source) override;
   void ActivateContents(content::WebContents* contents) override;
+  void ForwardCompositorProto(const std::vector<uint8_t>& proto) override;
 
   // Sets up and owns |new_contents|.
   void PlatformSetContents(scoped_ptr<content::WebContents> new_contents);
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 998223c..c3b9b8a 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -493,6 +493,7 @@
     "trees/proxy_common.h",
     "trees/proxy_impl.h",
     "trees/proxy_main.h",
+    "trees/remote_proto_channel.h",
     "trees/scoped_abort_remaining_swap_promises.h",
     "trees/single_thread_proxy.cc",
     "trees/single_thread_proxy.h",
diff --git a/cc/cc.gyp b/cc/cc.gyp
index a3602cc5..709bfc1 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -553,6 +553,7 @@
         'trees/proxy_common.h',
         'trees/proxy_impl.h',
         'trees/proxy_main.h',
+        'trees/remote_proto_channel.h',
         'trees/scoped_abort_remaining_swap_promises.h',
         'trees/single_thread_proxy.cc',
         'trees/single_thread_proxy.h',
@@ -584,6 +585,7 @@
       'target_name': 'cc_proto',
       'type': '<(component)',
       'sources': [
+        'proto/compositor_message.proto',
         'proto/display_item.proto',
         'proto/layer.proto',
         'proto/point.proto',
diff --git a/cc/proto/BUILD.gn b/cc/proto/BUILD.gn
index 31d3cd5..2465cfa5 100644
--- a/cc/proto/BUILD.gn
+++ b/cc/proto/BUILD.gn
@@ -29,6 +29,7 @@
   sources = [
     # TODO(dtrainor): Move protos to their correct packages once it's possible
     # to include protos from other directories/targets (crbug.com/542423).
+    "compositor_message.proto",
     "display_item.proto",
     "layer.proto",
     "point.proto",
diff --git a/cc/proto/compositor_message.proto b/cc/proto/compositor_message.proto
new file mode 100644
index 0000000..98c781c7
--- /dev/null
+++ b/cc/proto/compositor_message.proto
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package cc.proto;
+
+// A top level message for serialized state used by the compositor remote
+// channels.
+message CompositorMessage {
+  // One of these is set based on where the message is going to.
+  optional CompositorMessageToMain to_main = 1;
+  optional CompositorMessageToImpl to_impl = 2;
+}
+
+message CompositorMessageToMain {
+  // Placeholder for compositor message data meant for ChannelMain.
+}
+
+message CompositorMessageToImpl {
+  // Placeholder for compositor message data meant for ChannelImpl.
+}
\ No newline at end of file
diff --git a/cc/trees/remote_proto_channel.h b/cc/trees/remote_proto_channel.h
new file mode 100644
index 0000000..b0f1647
--- /dev/null
+++ b/cc/trees/remote_proto_channel.h
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TREES_REMOTE_PROTO_CHANNEL_H_
+#define CC_TREES_REMOTE_PROTO_CHANNEL_H_
+
+#include "base/memory/scoped_ptr.h"
+
+namespace cc {
+
+namespace proto {
+class CompositorMessage;
+}
+
+// Provides a bridge for getting compositor protobuf messages to/from the
+// outside world.
+class RemoteProtoChannel {
+ public:
+  // Meant to be implemented by a RemoteChannel that needs to receive and parse
+  // incoming protobufs.
+  class ProtoReceiver {
+   public:
+    virtual void OnProtoReceived(
+        scoped_ptr<proto::CompositorMessage> proto) = 0;
+
+   protected:
+    virtual ~ProtoReceiver() {}
+  };
+
+  virtual void SetProtoReceiver(ProtoReceiver* receiver) = 0;
+  virtual void SendCompositorProto(const proto::CompositorMessage& proto) = 0;
+
+ protected:
+  virtual ~RemoteProtoChannel() {}
+};
+
+}  // namespace cc
+
+#endif  // CC_TREES_REMOTE_PROTO_CHANNEL_H_
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index a96428c..604a3ac 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -5,6 +5,8 @@
 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_
 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_
 
+#include <vector>
+
 #include "base/basictypes.h"
 #include "build/build_config.h"
 #include "content/common/content_export.h"
@@ -163,6 +165,11 @@
   virtual gfx::NativeViewAccessible GetParentNativeViewAccessible();
 #endif
 
+  // Called when the widget has sent a compositor proto.  This is used in Blimp
+  // mode with the RemoteChannel compositor.
+  virtual void ForwardCompositorProto(RenderWidgetHostImpl* render_widget_host,
+                                      const std::vector<uint8_t>& proto) {}
+
  protected:
   virtual ~RenderWidgetHostDelegate() {}
 };
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 7f6269c..14633dc 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -477,6 +477,8 @@
                         OnImeCompositionRangeChanged)
     IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstPaintAfterLoad,
                         OnFirstPaintAfterLoad)
+    IPC_MESSAGE_HANDLER(ViewHostMsg_ForwardCompositorProto,
+                        OnForwardCompositorProto)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
 
@@ -1274,6 +1276,12 @@
   return false;
 }
 
+void RenderWidgetHostImpl::HandleCompositorProto(
+    const std::vector<uint8_t>& proto) {
+  DCHECK(!proto.empty());
+  Send(new ViewMsg_HandleCompositorProto(GetRoutingID(), proto));
+}
+
 void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
   color_profile_out_of_date_ = true;
 
@@ -1312,6 +1320,12 @@
   }
 }
 
+void RenderWidgetHostImpl::OnForwardCompositorProto(
+    const std::vector<uint8_t>& proto) {
+  if (delegate_)
+    delegate_->ForwardCompositorProto(this, proto);
+}
+
 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase,
                                                  base::TimeDelta interval) {
   Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval));
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 76f1f4d..678c422 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -159,6 +159,7 @@
   void RemoveMouseEventCallback(const MouseEventCallback& callback) override;
   void GetWebScreenInfo(blink::WebScreenInfo* result) override;
   bool GetScreenColorProfile(std::vector<char>* color_profile) override;
+  void HandleCompositorProto(const std::vector<uint8_t>& proto) override;
 
   // Notification that the screen info has changed.
   void NotifyScreenInfoChanged();
@@ -589,6 +590,7 @@
                           const gfx::Range& range);
   void OnSelectionBoundsChanged(
       const ViewHostMsg_SelectionBounds_Params& params);
+  void OnForwardCompositorProto(const std::vector<uint8_t>& proto);
 
   // Called (either immediately or asynchronously) after we're done with our
   // BackingStore and can send an ACK to the renderer so it can paint onto it
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index fdd38e2..6612d603 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1696,6 +1696,16 @@
     delegate_->LostMouseLock();
 }
 
+void WebContentsImpl::ForwardCompositorProto(
+    RenderWidgetHostImpl* render_widget_host,
+    const std::vector<uint8_t>& proto) {
+  if (render_widget_host != GetRenderViewHost()->GetWidget())
+    return;
+
+  if (delegate_)
+    delegate_->ForwardCompositorProto(proto);
+}
+
 void WebContentsImpl::CreateNewWindow(
     SiteInstance* source_site_instance,
     int32_t route_id,
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 8fc9649..f8d02c9 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -602,6 +602,8 @@
       RenderWidgetHostImpl* render_widget_host) const override;
   void LostCapture(RenderWidgetHostImpl* render_widget_host) override;
   void LostMouseLock(RenderWidgetHostImpl* render_widget_host) override;
+  void ForwardCompositorProto(RenderWidgetHostImpl* render_widget_host,
+                              const std::vector<uint8_t>& proto) override;
 
   // RenderFrameHostManager::Delegate ------------------------------------------
 
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 3421e4af..9e9ea06 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -975,6 +975,10 @@
 IPC_MESSAGE_ROUTED1(ViewMsg_BeginFrame,
                     cc::BeginFrameArgs /* args */)
 
+// Sent by the browser to deliver a compositor proto to the renderer.
+IPC_MESSAGE_ROUTED1(ViewMsg_HandleCompositorProto,
+                    std::vector<uint8_t> /* proto */)
+
 // -----------------------------------------------------------------------------
 // Messages sent from the renderer to the browser.
 
@@ -1345,6 +1349,10 @@
 // See https://crbug.com/537793.
 IPC_MESSAGE_ROUTED0(ViewHostMsg_DidFirstPaintAfterLoad)
 
+// Sent by the renderer to deliver a compositor proto to the browser.
+IPC_MESSAGE_ROUTED1(ViewHostMsg_ForwardCompositorProto,
+                    std::vector<uint8_t> /* proto */)
+
 #if defined(OS_ANDROID)
 // Response to ViewMsg_FindMatchRects.
 //
diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi
index adc6ba0..cb9dae19 100644
--- a/content/content_renderer.gypi
+++ b/content/content_renderer.gypi
@@ -7,6 +7,7 @@
     '../base/base.gyp:base',
     '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
     '../cc/cc.gyp:cc',
+    '../cc/cc.gyp:cc_proto',
     '../cc/blink/cc_blink.gyp:cc_blink',
     '../components/components.gyp:startup_metric_utils_common',
     '../components/components.gyp:webusb',
diff --git a/content/public/browser/render_widget_host.h b/content/public/browser/render_widget_host.h
index fe4361a..2fda607 100644
--- a/content/public/browser/render_widget_host.h
+++ b/content/public/browser/render_widget_host.h
@@ -245,6 +245,9 @@
   virtual void GetWebScreenInfo(blink::WebScreenInfo* result) = 0;
   // Get the color profile corresponding to this render widget.
   virtual bool GetScreenColorProfile(std::vector<char>* color_profile) = 0;
+
+  // Sends a compositor proto to the render widget.
+  virtual void HandleCompositorProto(const std::vector<uint8_t>& proto) = 0;
 };
 
 }  // namespace content
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 40a49049a..f6a04a5 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -510,6 +510,10 @@
       WebContents* web_contents,
       int cert_id);
 
+  // Called when the active render widget is forwarding a RemoteChannel
+  // compositor proto.  This is used in Blimp mode.
+  virtual void ForwardCompositorProto(const std::vector<uint8_t>& proto) {}
+
  protected:
   virtual ~WebContentsDelegate();
 
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 42da81ac..6fd2acb 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -28,6 +28,7 @@
     "//base/allocator",
     "//cc",
     "//cc/blink",
+    "//cc/proto",
     "//components/scheduler:scheduler",
     "//components/startup_metric_utils/common",
     "//components/url_formatter",
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 64194686..0eb8bc0 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -10,6 +10,7 @@
 #include "base/command_line.h"
 #include "base/location.h"
 #include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
 #include "base/single_thread_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/synchronization/lock.h"
@@ -31,10 +32,12 @@
 #include "cc/output/copy_output_result.h"
 #include "cc/output/latency_info_swap_promise.h"
 #include "cc/output/swap_promise.h"
+#include "cc/proto/compositor_message.pb.h"
 #include "cc/resources/single_release_callback.h"
 #include "cc/scheduler/begin_frame_source.h"
 #include "cc/trees/latency_info_swap_promise_monitor.h"
 #include "cc/trees/layer_tree_host.h"
+#include "cc/trees/remote_proto_channel.h"
 #include "components/scheduler/renderer/renderer_scheduler.h"
 #include "content/common/content_switches_internal.h"
 #include "content/common/gpu/client/context_provider_command_buffer.h"
@@ -215,6 +218,7 @@
       compositor_deps_(compositor_deps),
       never_visible_(false),
       layout_and_paint_async_callback_(nullptr),
+      remote_proto_channel_receiver_(nullptr),
       weak_factory_(this) {
 }
 
@@ -968,6 +972,19 @@
   widget_->OnSwapBuffersAborted();
 }
 
+void RenderWidgetCompositor::SetProtoReceiver(ProtoReceiver* receiver) {
+  remote_proto_channel_receiver_ = receiver;
+}
+
+void RenderWidgetCompositor::SendCompositorProto(
+    const cc::proto::CompositorMessage& proto) {
+  int signed_size = proto.ByteSize();
+  size_t unsigned_size = base::checked_cast<size_t>(signed_size);
+  std::vector<uint8_t> serialized(unsigned_size);
+  proto.SerializeToArray(serialized.data(), signed_size);
+  widget_->ForwardCompositorProto(serialized);
+}
+
 void RenderWidgetCompositor::RecordFrameTimingEvents(
     scoped_ptr<cc::FrameTimingTracker::CompositeTimingSet> composite_events,
     scoped_ptr<cc::FrameTimingTracker::MainFrameTimingSet> main_frame_events) {
@@ -1005,6 +1022,21 @@
   layer_tree_host_->set_surface_id_namespace(surface_id_namespace);
 }
 
+void RenderWidgetCompositor::OnHandleCompositorProto(
+    const std::vector<uint8_t>& proto) {
+  DCHECK(remote_proto_channel_receiver_);
+
+  scoped_ptr<cc::proto::CompositorMessage> deserialized(
+      new cc::proto::CompositorMessage);
+  int signed_size = base::checked_cast<int>(proto.size());
+  if (!deserialized->ParseFromArray(proto.data(), signed_size)) {
+    LOG(ERROR) << "Unable to parse compositor proto.";
+    return;
+  }
+
+  remote_proto_channel_receiver_->OnProtoReceived(deserialized.Pass());
+}
+
 cc::ManagedMemoryPolicy RenderWidgetCompositor::GetGpuMemoryPolicy(
     const cc::ManagedMemoryPolicy& policy) {
   cc::ManagedMemoryPolicy actual = policy;
diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h
index fa3ba31..3a37e50 100644
--- a/content/renderer/gpu/render_widget_compositor.h
+++ b/content/renderer/gpu/render_widget_compositor.h
@@ -15,6 +15,7 @@
 #include "cc/trees/layer_tree_host_client.h"
 #include "cc/trees/layer_tree_host_single_thread_client.h"
 #include "cc/trees/layer_tree_settings.h"
+#include "cc/trees/remote_proto_channel.h"
 #include "cc/trees/swap_promise_monitor.h"
 #include "content/common/content_export.h"
 #include "content/renderer/gpu/compositor_dependencies.h"
@@ -31,6 +32,11 @@
 class InputHandler;
 class Layer;
 class LayerTreeHost;
+
+namespace proto {
+class CompositorMessage;
+}
+
 }
 
 namespace content {
@@ -39,7 +45,8 @@
 class CONTENT_EXPORT RenderWidgetCompositor
     : NON_EXPORTED_BASE(public blink::WebLayerTreeView),
       NON_EXPORTED_BASE(public cc::LayerTreeHostClient),
-      NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient) {
+      NON_EXPORTED_BASE(public cc::LayerTreeHostSingleThreadClient),
+      NON_EXPORTED_BASE(public cc::RemoteProtoChannel) {
  public:
   // Attempt to construct and initialize a compositor instance for the widget
   // with the given settings. Returns NULL if initialization fails.
@@ -79,6 +86,7 @@
       const base::Callback<void(scoped_ptr<base::Value>)>& callback);
   bool SendMessageToMicroBenchmark(int id, scoped_ptr<base::Value> value);
   void SetSurfaceIdNamespace(uint32_t surface_id_namespace);
+  void OnHandleCompositorProto(const std::vector<uint8_t>& proto);
   cc::ManagedMemoryPolicy GetGpuMemoryPolicy(
       const cc::ManagedMemoryPolicy& policy);
   void SetPaintedDeviceScaleFactor(float device_scale);
@@ -164,6 +172,10 @@
   void DidPostSwapBuffers() override;
   void DidAbortSwapBuffers() override;
 
+  // cc::RemoteProtoChannel implementation.
+  void SetProtoReceiver(ProtoReceiver* receiver) override;
+  void SendCompositorProto(const cc::proto::CompositorMessage& proto) override;
+
   enum {
     OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK = 4,
     MAX_OUTPUT_SURFACE_RETRIES = 5,
@@ -191,6 +203,8 @@
   blink::WebLayoutAndPaintAsyncCallback* layout_and_paint_async_callback_;
   scoped_ptr<cc::CopyOutputRequest> temporary_copy_output_request_;
 
+  cc::RemoteProtoChannel::ProtoReceiver* remote_proto_channel_receiver_;
+
   base::WeakPtrFactory<RenderWidgetCompositor> weak_factory_;
 };
 
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 9a8aaf1..3f4c190 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -753,6 +753,7 @@
     IPC_MESSAGE_HANDLER(InputMsg_ImeEventAck, OnImeEventAck)
     IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded)
 #endif
+    IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   return handled;
@@ -1753,6 +1754,11 @@
     compositor_->SetSurfaceIdNamespace(surface_id_namespace);
 }
 
+void RenderWidget::OnHandleCompositorProto(const std::vector<uint8_t>& proto) {
+  if (compositor_)
+    compositor_->OnHandleCompositorProto(proto);
+}
+
 void RenderWidget::showImeIfNeeded() {
   OnShowImeIfNeeded();
 }
@@ -2047,6 +2053,10 @@
   UpdateCompositionInfo(false);
 }
 
+void RenderWidget::ForwardCompositorProto(const std::vector<uint8_t>& proto) {
+  Send(new ViewHostMsg_ForwardCompositorProto(routing_id_, proto));
+}
+
 // Check blink::WebTextInputType and ui::TextInputType is kept in sync.
 #define STATIC_ASSERT_WTIT_ENUM_MATCH(a, b)            \
     static_assert(int(blink::WebTextInputType##a)      \
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index d062a1f..b7ef993 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -302,6 +302,10 @@
   // the new value will be sent to the browser process.
   void UpdateSelectionBounds();
 
+  // Called by the compositor to forward a proto that represents serialized
+  // compositor state.
+  void ForwardCompositorProto(const std::vector<uint8_t>& proto);
+
   virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end);
 
   void OnShowHostContextMenu(ContextMenuParams* params);
@@ -447,6 +451,7 @@
                            const gfx::Rect& window_screen_rect);
   void OnShowImeIfNeeded();
   void OnSetSurfaceIdNamespace(uint32_t surface_id_namespace);
+  void OnHandleCompositorProto(const std::vector<uint8_t>& proto);
 
 #if defined(OS_ANDROID)
   // Called when we send IME event that expects an ACK.