OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 [DartPackage="_mojo_for_test_only", | |
6 JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] | |
7 module sample; | |
8 | |
9 import "sample_import.mojom"; | |
10 | |
11 // This sample shows how handles to MessagePipes can be sent as both parameters | |
12 // to methods as well as fields on structs. | |
13 | |
14 struct Request { | |
15 int32 x; | |
16 handle<message_pipe>? pipe; | |
17 array<handle<message_pipe>>? more_pipes; | |
18 | |
19 // Interfaces can be used as members. | |
20 imported.ImportedInterface? obj; | |
21 }; | |
22 | |
23 struct Response { | |
24 int32 x; | |
25 handle<message_pipe>? pipe; | |
26 }; | |
27 | |
28 [ServiceName="sample::NamedObject"] | |
29 interface NamedObject { | |
30 SetName(string name); | |
31 GetName() => (string name); | |
32 }; | |
33 | |
34 interface Factory { | |
35 DoStuff(Request request, handle<message_pipe>? pipe) | |
36 => (Response response, string text); | |
37 DoStuff2(handle<data_pipe_consumer> pipe) => (string text); | |
38 CreateNamedObject(NamedObject& obj); | |
39 RequestImportedInterface(imported.ImportedInterface& obj) | |
40 => (imported.ImportedInterface& obj); | |
41 TakeImportedInterface(imported.ImportedInterface obj) | |
42 => (imported.ImportedInterface obj); | |
43 }; | |
OLD | NEW |