summaryrefslogtreecommitdiffstats
path: root/mojo/public/bindings/tests/sample_factory.mojom
blob: 5f076df583720f441f99bf2be76545ec8f2ca639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module sample {

// This sample shows how handles to MessagePipes can be sent as both parameters
// to methods as well as fields on structs.

struct Request {
  int32 x;
  handle<message_pipe> pipe;
};

struct Response {
  int32 x;
  handle<message_pipe> pipe;
};

[Peer=FactoryClient]
interface Factory {
  void DoStuff(Request request, handle<message_pipe> pipe);
  void DoStuff2(handle<data_pipe_consumer> pipe);
};

[Peer=Factory]
interface FactoryClient {
  void DidStuff(Response response, string text);
  void DidStuff2(string text);
};

}  // module sample