1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Contains the BlimpMessage proto which frames all messages sent over Blimp
6 // subchannels. BlimpMessage protos are serialized and transmitted over the
7 // wire to the Blimplet server.
9 // Each BlimpMessage has a few identifying fields which provide the browser
10 // session and tab ID as context. The message details are stored in a
11 // feature-specific field (see field IDs 1000 and onward).
12 // The |type| field tells the receiving end how the BlimpMessage should
13 // be unpacked and which component it should be routed to.
16 // * A BlimpMessage can contain only one feature message.
17 // * Feature message protos are placed in their own files.
18 // * Features are applied to unidirectional channels. Client->server and
19 // server->client channels for a component should be broken out as distinct
20 // features, even if they are conceptually similar.
21 // * Shared proto types are contained in 'common.proto'.
25 option optimize_for = LITE_RUNTIME;
27 import "client_control.proto";
28 import "compositor.proto";
30 import "server_control.proto";
34 message BlimpMessage {
41 // Identifies the feature type of this message.
42 // The feature-specific contents are contained in optional fields of the same
43 // name (example: use |compositor| field for type=COMPOSITOR.)
44 optional Type type = 1;
46 // Uniquely identifies the Blimp session that originated this message.
47 // Session IDs are invalidated whenever new sessions are created.
48 // If a message's |session_id| does not match the client's session ID,
49 // then the message may have originated from a discarded session and can be
51 optional int32 session_id = 2;
53 // ID of the tab that is referenced by this message.
54 // Messages that are tab-agnostic may leave this field unset.
55 optional int32 target_tab_id = 3;
57 // Feature-specific messages follow.
58 // Only one of these fields may be set per BlimpMessage.
59 // TODO(kmarshall): use a 'oneof' union when it's supported in Chromium.
60 optional CompositorMessage compositor = 1000;
61 optional InputMessage input = 1001;
62 optional ClientControlMessage client_control = 1002;
63 optional ServerControlMessage server_control = 1003;