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 [JavaPackage="org.chromium.mojo.bindings.test.sample"] | 5 [JavaPackage="org.chromium.mojo.bindings.test.sample"] |
6 module sample { | 6 module sample { |
7 | 7 |
8 // This sample shows how handles to MessagePipes can be sent as both parameters | 8 // This sample shows how handles to MessagePipes can be sent as both parameters |
9 // to methods as well as fields on structs. | 9 // to methods as well as fields on structs. |
10 | 10 |
11 struct Request { | 11 struct Request { |
12 int32 x; | 12 int32 x; |
13 handle<message_pipe> pipe; | 13 handle<message_pipe> pipe; |
14 handle<message_pipe>[] more_pipes; | 14 handle<message_pipe>[] more_pipes; |
15 }; | 15 }; |
16 | 16 |
17 struct Response { | 17 struct Response { |
18 int32 x; | 18 int32 x; |
19 handle<message_pipe> pipe; | 19 handle<message_pipe> pipe; |
20 }; | 20 }; |
21 | 21 |
| 22 interface Object { |
| 23 SetName(string name); |
| 24 GetName() => (string name); |
| 25 }; |
| 26 |
22 [Client=FactoryClient] | 27 [Client=FactoryClient] |
23 interface Factory { | 28 interface Factory { |
24 DoStuff(Request request, handle<message_pipe> pipe); | 29 DoStuff(Request request, handle<message_pipe> pipe); |
25 DoStuff2(handle<data_pipe_consumer> pipe); | 30 DoStuff2(handle<data_pipe_consumer> pipe); |
| 31 CreateObject(Object& obj); |
26 }; | 32 }; |
27 | 33 |
28 interface FactoryClient { | 34 interface FactoryClient { |
29 DidStuff(Response response, string text); | 35 DidStuff(Response response, string text); |
30 DidStuff2(string text); | 36 DidStuff2(string text); |
31 }; | 37 }; |
32 | 38 |
33 } // module sample | 39 } // module sample |
OLD | NEW |