OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 import "sample_import.mojom" | 5 import "sample_import.mojom" |
6 import "sample_import2.mojom" | 6 import "sample_import2.mojom" |
7 | 7 |
8 [JavaPackage="org.chromium.mojo.bindings.test"] | 8 [JavaPackage="org.chromium.mojo.bindings.test.sample"] |
9 module sample { | 9 module sample { |
10 | 10 |
11 const uint8 kThree = 3; | 11 const uint8 kThree = 3; |
12 | 12 |
13 struct Bar { | 13 struct Bar { |
14 enum Type { | 14 enum Type { |
15 TYPE_VERTICAL = 1 << 0, | 15 TYPE_VERTICAL = 1 << 0, |
16 TYPE_HORIZONTAL = (1 << 1) + 0, | 16 TYPE_HORIZONTAL = (1 << 1) + 0, |
17 TYPE_BOTH = TYPE_VERTICAL | TYPE_HORIZONTAL, | 17 TYPE_BOTH = TYPE_VERTICAL | TYPE_HORIZONTAL, |
18 TYPE_INVALID | 18 TYPE_INVALID |
(...skipping 12 matching lines...) Expand all Loading... |
31 int32 y @1; | 31 int32 y @1; |
32 bool a = true @2; | 32 bool a = true @2; |
33 bool b @3; | 33 bool b @3; |
34 bool c @4; | 34 bool c @4; |
35 Bar bar @5; | 35 Bar bar @5; |
36 Bar[] extra_bars @7; | 36 Bar[] extra_bars @7; |
37 uint8[] data = [1,2,kThree] @6; | 37 uint8[] data = [1,2,kThree] @6; |
38 handle<message_pipe> source @9; | 38 handle<message_pipe> source @9; |
39 handle<data_pipe_consumer>[] input_streams @10; | 39 handle<data_pipe_consumer>[] input_streams @10; |
40 handle<data_pipe_producer>[] output_streams @11; | 40 handle<data_pipe_producer>[] output_streams @11; |
41 bool[][] array_of_array_of_bools @12; | 41 bool[][] array_of_array_of_bools = [[true], [false, true]] @12; |
| 42 string[][][] multi_array_of_strings @13; |
42 }; | 43 }; |
43 | 44 |
44 struct DefaultsTestInner { | 45 struct DefaultsTestInner { |
45 int32 age @2; | 46 int32 age @2; |
46 string[] names = ["Jim"] @1; | 47 string[] names = ["Jim"] @1; |
47 int32 height = 6*12 @3; | 48 int32 height = 6*12 @3; |
48 }; | 49 }; |
49 | 50 |
50 struct DefaultsTest { | 51 struct DefaultsTest { |
51 sample.DefaultsTestInner[] people = [{32, ["Bob", "Bobby"]}] @1; | 52 sample.DefaultsTestInner[] people = [{32, ["Bob", "Bobby"]}] @1; |
52 uint8[] data = [1, 2, 3] @2; | 53 uint8[] data = [1, 2, 3] @2; |
53 imported.Point point = {7, 15} @3; | 54 imported.Point point = {7, 15} @3; |
54 int32[] shape_masks = [1 << imported.SHAPE_RECTANGLE] @4; | 55 int32[] shape_masks = [1 << imported.SHAPE_RECTANGLE] @4; |
55 imported.Thing thing = {imported.SHAPE_CIRCLE, imported.COLOR_BLACK}; | 56 imported.Thing thing = {imported.SHAPE_CIRCLE, imported.COLOR_BLACK}; |
56 Bar.Type bar_type = Bar.TYPE_BOTH; | 57 Bar.Type bar_type = Bar.TYPE_BOTH; |
57 }; | 58 }; |
58 | 59 |
| 60 struct StructWithHoleV1 { |
| 61 int32 v1 = 1; |
| 62 int64 v2 = 2; |
| 63 }; |
| 64 |
| 65 struct StructWithHoleV2 { |
| 66 int32 v1 = 1; |
| 67 int64 v2 = 2; |
| 68 int32 v3 = 3; |
| 69 }; |
| 70 |
59 [Client=ServiceClient] | 71 [Client=ServiceClient] |
60 interface Service { | 72 interface Service { |
61 enum BazOptions { | 73 enum BazOptions { |
62 BAZ_REGULAR = 0, | 74 BAZ_REGULAR = 0, |
63 BAZ_EXTRA | 75 BAZ_EXTRA |
64 }; | 76 }; |
65 const uint8 kFavoriteBaz = 1; | 77 const uint8 kFavoriteBaz = 1; |
66 Frobinate@0(Foo foo @0, BazOptions baz @1, Port port @2); | 78 Frobinate@0(Foo foo @0, BazOptions baz @1, Port port @2); |
67 }; | 79 }; |
68 | 80 |
69 interface ServiceClient { | 81 interface ServiceClient { |
70 DidFrobinate@0(int32 result @0); | 82 DidFrobinate@0(int32 result @0); |
71 }; | 83 }; |
72 | 84 |
73 // This interface is referenced above where it is defined. It also refers to | 85 // This interface is referenced above where it is defined. It also refers to |
74 // itself from a method. | 86 // itself from a method. |
75 interface Port { | 87 interface Port { |
76 PostMessage@0(string message_text @0, Port port@1); | 88 PostMessage@0(string message_text @0, Port port@1); |
77 }; | 89 }; |
78 | 90 |
79 } | 91 } |
OLD | NEW |