From 160f8eca573286f3bb369975ac2e9de63b0cc477 Mon Sep 17 00:00:00 2001 From: dtrainor Date: Mon, 30 Nov 2015 16:53:05 -0800 Subject: Add glue between the client and engine for Blimp - Add BlimpMessageProcessors to handle RENDER_WIDGET, INPUT, and COMPOSITOR message types to/from the client and engine. - Tie the message processors into BlimpCompositor on the client and BlimpEngineSession on the server. - Update BlimpView and BlimpCompositor to fix how we handle output surfaces and how we shut down and build the LayerTreeHost based on incoming RENDER_WIDGET and COMPOSITOR messages. BUG=550693 Review URL: https://codereview.chromium.org/1450423002 Cr-Commit-Position: refs/heads/master@{#362299} --- blimp/common/proto/BUILD.gn | 3 ++- blimp/common/proto/blimp_message.proto | 20 +++++++++++--------- blimp/common/proto/common.proto | 17 ----------------- blimp/common/proto/compositor.proto | 9 ++++++--- blimp/common/proto/control.proto | 12 ++++++++++++ blimp/common/proto/input.proto | 5 +++-- blimp/common/proto/render_widget.proto | 23 +++++++++++++++++++++++ blimp/common/proto/size.proto | 17 +++++++++++++++++ 8 files changed, 74 insertions(+), 32 deletions(-) delete mode 100644 blimp/common/proto/common.proto create mode 100644 blimp/common/proto/render_widget.proto create mode 100644 blimp/common/proto/size.proto (limited to 'blimp/common') diff --git a/blimp/common/proto/BUILD.gn b/blimp/common/proto/BUILD.gn index 5ca8283..fa564eb 100644 --- a/blimp/common/proto/BUILD.gn +++ b/blimp/common/proto/BUILD.gn @@ -26,11 +26,12 @@ proto_library("proto_internal") { sources = [ "blimp_message.proto", - "common.proto", "compositor.proto", "control.proto", "input.proto", "navigation.proto", + "render_widget.proto", + "size.proto", ] cc_generator_options = "dllexport_decl=BLIMP_PROTO_EXPORT:" diff --git a/blimp/common/proto/blimp_message.proto b/blimp/common/proto/blimp_message.proto index 9b11684..505e0f4 100644 --- a/blimp/common/proto/blimp_message.proto +++ b/blimp/common/proto/blimp_message.proto @@ -18,7 +18,6 @@ // * Features are applied to unidirectional channels. Client->server and // server->client channels for a component should be broken out as distinct // features, even if they are conceptually similar. -// * Shared proto types are contained in 'common.proto'. syntax = "proto2"; @@ -28,16 +27,18 @@ import "control.proto"; import "compositor.proto"; import "input.proto"; import "navigation.proto"; +import "render_widget.proto"; package blimp; message BlimpMessage { enum Type { UNKNOWN = 0; - COMPOSITOR = 1; - INPUT = 2; - CONTROL = 3; - NAVIGATION = 4; + CONTROL = 1; + NAVIGATION = 2; + RENDER_WIDGET = 3; + INPUT = 4; + COMPOSITOR = 5; } // Identifies the feature type of this message. // The feature-specific contents are contained in optional fields of the same @@ -58,9 +59,10 @@ message BlimpMessage { // Feature-specific messages follow. // Only one of these fields may be set per BlimpMessage. // TODO(kmarshall): use a 'oneof' union when it's supported in Chromium. - optional CompositorMessage compositor = 1000; - optional InputMessage input = 1001; - optional ControlMessage control = 1002; - optional NavigationMessage navigation = 1003; + optional ControlMessage control = 1000; + optional NavigationMessage navigation = 1001; + optional RenderWidgetMessage render_widget = 1002; + optional InputMessage input = 1003; + optional CompositorMessage compositor = 1004; } diff --git a/blimp/common/proto/common.proto b/blimp/common/proto/common.proto deleted file mode 100644 index 578c02b..0000000 --- a/blimp/common/proto/common.proto +++ /dev/null @@ -1,17 +0,0 @@ -// 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. -// -// Common message types for sharing across Blimp subprotocols. - -syntax = "proto2"; - -option optimize_for = LITE_RUNTIME; - -package blimp; - -message CoordinatePair { - optional sint32 x = 1; - optional sint32 y = 2; -} - diff --git a/blimp/common/proto/compositor.proto b/blimp/common/proto/compositor.proto index bd5f826..a015c24 100644 --- a/blimp/common/proto/compositor.proto +++ b/blimp/common/proto/compositor.proto @@ -4,8 +4,6 @@ // // Message definitions for the compositor subprotocol. -// TODO(nyquist): Import cc proto files. - syntax = "proto2"; option optimize_for = LITE_RUNTIME; @@ -13,6 +11,11 @@ option optimize_for = LITE_RUNTIME; package blimp; message CompositorMessage { - // TODO(nyquist): Include the cc proto message here. + // An ID that corresponds to RenderWidgetMessage.render_widget_id. + optional uint32 render_widget_id = 1; + + // This represents a serialized CompositorMessage in + // cc/proto/compositor_message.proto. + optional bytes payload = 2; } diff --git a/blimp/common/proto/control.proto b/blimp/common/proto/control.proto index bcb9aaa..1a909b6 100644 --- a/blimp/common/proto/control.proto +++ b/blimp/common/proto/control.proto @@ -8,6 +8,10 @@ syntax = "proto2"; option optimize_for = LITE_RUNTIME; +import "size.proto"; + +package blimp; + message ControlMessage { enum Type { UNKNOWN = 0; @@ -15,6 +19,14 @@ message ControlMessage { // Client <=> Server types. CREATE_TAB = 1; CLOSE_TAB = 2; + + // Client => Server types. + SIZE = 3; } + optional Type type = 1; + + // Feature-specific messages follow. + // Only one of these fields may be set per ControlMessage. + optional SizeMessage resize = 1000; } diff --git a/blimp/common/proto/input.proto b/blimp/common/proto/input.proto index fa6fe62..7b9a404 100644 --- a/blimp/common/proto/input.proto +++ b/blimp/common/proto/input.proto @@ -11,8 +11,6 @@ syntax = "proto2"; option optimize_for = LITE_RUNTIME; -import "common.proto"; - package blimp; message GestureCommon { @@ -78,6 +76,9 @@ message InputMessage { optional Type type = 1; + // An ID that corresponds to RenderWidgetMessage.render_widget_id. + optional uint32 render_widget_id = 10; + // Seconds since client platform start (boot) with millisecond resolution. // On Android, this is based off of the client's SystemClock#uptimeMillis(). optional double timestamp_seconds = 2; diff --git a/blimp/common/proto/render_widget.proto b/blimp/common/proto/render_widget.proto new file mode 100644 index 0000000..480371b --- /dev/null +++ b/blimp/common/proto/render_widget.proto @@ -0,0 +1,23 @@ +// 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 blimp; + +message RenderWidgetMessage { + enum Type { + // TODO(dtrainor): Leaving this a bit open in case we need to send other + // types of RenderWidget messages (like shutdown). + + // Engine => Client types. + INITIALIZE = 1; + } + + optional Type type = 1; + optional uint32 render_widget_id = 2; +} \ No newline at end of file diff --git a/blimp/common/proto/size.proto b/blimp/common/proto/size.proto new file mode 100644 index 0000000..f6ba801 --- /dev/null +++ b/blimp/common/proto/size.proto @@ -0,0 +1,17 @@ +// 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 blimp; + +// Contains display information that represents resize events coming from the +// client device. +message SizeMessage { + optional uint64 width = 1; + optional uint64 height = 2; +} + -- cgit v1.1