Upstream version 8.37.180.0
[platform/framework/web/crosswalk.git] / src / mojo / public / interfaces / bindings / tests / sample_factory.mojom
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 import "sample_import.mojom"
6
7 [JavaPackage="org.chromium.mojo.bindings.test.sample"]
8 module sample {
9
10 // This sample shows how handles to MessagePipes can be sent as both parameters
11 // to methods as well as fields on structs.
12
13 struct Request {
14   int32 x;
15   handle<message_pipe> pipe;
16   handle<message_pipe>[] more_pipes;
17 };
18
19 struct Response {
20   int32 x;
21   handle<message_pipe> pipe;
22 };
23
24 interface Object {
25   SetName(string name);
26   GetName() => (string name);
27 };
28
29 [Client=FactoryClient]
30 interface Factory {
31   DoStuff(Request request, handle<message_pipe> pipe);
32   DoStuff2(handle<data_pipe_consumer> pipe);
33   CreateObject(Object& obj);
34   RequestImportedInterface(
35       imported.ImportedInterface& obj) => (imported.ImportedInterface& obj);
36   TakeImportedInterface(
37       imported.ImportedInterface obj) => (imported.ImportedInterface obj);
38 };
39
40 interface FactoryClient {
41   DidStuff(Response response, string text);
42   DidStuff2(string text);
43 };
44
45 }  // module sample