OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Contains the BlimpMessage proto which frames all messages sent over Blimp | 5 // Contains the BlimpMessage proto which frames all messages sent over Blimp |
6 // subchannels. BlimpMessage protos are serialized and transmitted over the | 6 // subchannels. BlimpMessage protos are serialized and transmitted over the |
7 // wire to the Blimplet server. | 7 // wire to the Blimplet server. |
8 // | 8 // |
9 // Each BlimpMessage has a few identifying fields which provide the browser | 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 | 10 // session and tab ID as context. The message details are stored in a |
(...skipping 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 import "control.proto"; | 27 import "control.proto"; |
28 import "compositor.proto"; | 28 import "compositor.proto"; |
29 import "input.proto"; | 29 import "input.proto"; |
30 import "navigation.proto"; | 30 import "navigation.proto"; |
31 | 31 |
32 package blimp; | 32 package blimp; |
33 | 33 |
34 message BlimpMessage { | 34 message BlimpMessage { |
35 enum Type { | 35 enum Type { |
36 COMPOSITOR = 0; | 36 UNKNOWN = 0; |
maniscalco
2015/11/20 22:33:48
Breaking the cardinal rule here, but I believe it'
Wez
2015/11/20 23:33:39
Agreed; we are OK w/ breaking changes to the proto
maniscalco
2015/11/20 23:42:21
The convention I'm familiar with is to use UNKNOWN
| |
37 INPUT = 1; | 37 COMPOSITOR = 1; |
38 CONTROL = 2; | 38 INPUT = 2; |
39 NAVIGATION = 3; | 39 CONTROL = 3; |
40 NAVIGATION = 4; | |
40 } | 41 } |
41 // Identifies the feature type of this message. | 42 // Identifies the feature type of this message. |
42 // The feature-specific contents are contained in optional fields of the same | 43 // The feature-specific contents are contained in optional fields of the same |
43 // name (example: use |compositor| field for type=COMPOSITOR.) | 44 // name (example: use |compositor| field for type=COMPOSITOR.) |
44 optional Type type = 1; | 45 optional Type type = 1; |
45 | 46 |
46 // Uniquely identifies the Blimp session that originated this message. | 47 // Uniquely identifies the Blimp session that originated this message. |
47 // Session IDs are invalidated whenever new sessions are created. | 48 // 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 // 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 | 50 // then the message may have originated from a discarded session and can be |
50 // safely ignored. | 51 // safely ignored. |
51 optional int32 session_id = 2; | 52 optional int32 session_id = 2; |
52 | 53 |
53 // ID of the tab that is referenced by this message. | 54 // ID of the tab that is referenced by this message. |
54 // Messages that are tab-agnostic may leave this field unset. | 55 // Messages that are tab-agnostic may leave this field unset. |
55 optional int32 target_tab_id = 3; | 56 optional int32 target_tab_id = 3; |
56 | 57 |
57 // Feature-specific messages follow. | 58 // Feature-specific messages follow. |
58 // Only one of these fields may be set per BlimpMessage. | 59 // Only one of these fields may be set per BlimpMessage. |
59 // TODO(kmarshall): use a 'oneof' union when it's supported in Chromium. | 60 // TODO(kmarshall): use a 'oneof' union when it's supported in Chromium. |
60 optional CompositorMessage compositor = 1000; | 61 optional CompositorMessage compositor = 1000; |
61 optional InputMessage input = 1001; | 62 optional InputMessage input = 1001; |
62 optional ControlMessage control = 1002; | 63 optional ControlMessage control = 1002; |
63 optional NavigationMessage navigation = 1003; | 64 optional NavigationMessage navigation = 1003; |
64 } | 65 } |
65 | 66 |
OLD | NEW |