Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: mojo/public/bindings/tests/sample_service.mojom

Issue 139613005: Support default values for complex objects in mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 module sample { 5 module sample {
6 6
7 enum BarType { 7 enum BarType {
8 BAR_VERTICAL = 1 << 0, 8 BAR_VERTICAL = 1 << 0,
9 BAR_HORIZONTAL = (1 << 1) + 0, 9 BAR_HORIZONTAL = (1 << 1) + 0,
10 BAR_BOTH = BAR_VERTICAL | BAR_HORIZONTAL, 10 BAR_BOTH = BAR_VERTICAL | BAR_HORIZONTAL,
(...skipping 16 matching lines...) Expand all
27 bool b @3; 27 bool b @3;
28 bool c @4; 28 bool c @4;
29 Bar bar @5; 29 Bar bar @5;
30 Bar[] extra_bars @7; 30 Bar[] extra_bars @7;
31 uint8[] data = [1,2,3] @6; 31 uint8[] data = [1,2,3] @6;
32 handle<message_pipe> source @9; 32 handle<message_pipe> source @9;
33 handle<data_pipe_consumer>[] input_streams @10; 33 handle<data_pipe_consumer>[] input_streams @10;
34 handle<data_pipe_producer>[] output_streams @11; 34 handle<data_pipe_producer>[] output_streams @11;
35 }; 35 };
36 36
37 struct DefaultsTestInner {
38 int32 age @2;
39 string[] names = ["Jim"] @1;
40 int32 height = 6*12 @3;
41 };
42
43 struct DefaultsTest {
44 DefaultsTestInner[] people = [{32, ["Bob", "Bobby"]}] @1;
45 uint8[] data = [1, 2, 3] @2;
46 };
47
37 [Peer=ServiceClient] 48 [Peer=ServiceClient]
38 interface Service { 49 interface Service {
39 enum BazOptions { 50 enum BazOptions {
40 BAZ_REGULAR = 0, 51 BAZ_REGULAR = 0,
41 BAZ_EXTRA 52 BAZ_EXTRA
42 }; 53 };
43 void Frobinate(Foo foo @0, int32 baz @1, handle<message_pipe> port @2) @0; 54 void Frobinate(Foo foo @0, int32 baz @1, handle<message_pipe> port @2) @0;
44 }; 55 };
45 56
46 [Peer=Service] 57 [Peer=Service]
47 interface ServiceClient { 58 interface ServiceClient {
48 void DidFrobinate(int32 result @0) @0; 59 void DidFrobinate(int32 result @0) @0;
49 }; 60 };
50 61
51 } 62 }
OLDNEW
« no previous file with comments | « mojo/public/bindings/pylib/parse/mojo_parser.py ('k') | mojo/public/bindings/tests/sample_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698