OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 IPC.mojom; | 5 module IPC.mojom; |
6 | 6 |
7 struct SerializedHandle { | 7 struct SerializedHandle { |
8 handle the_handle; | 8 handle the_handle; |
9 | 9 |
10 enum Type { | 10 enum Type { |
11 MOJO_HANDLE, | 11 MOJO_HANDLE, |
12 WIN_HANDLE, | 12 WIN_HANDLE, |
13 MACH_PORT, | 13 MACH_PORT, |
14 }; | 14 }; |
15 | 15 |
16 Type type; | 16 Type type; |
17 }; | 17 }; |
18 | 18 |
19 struct Message { | |
20 array<uint8> data; | |
21 array<SerializedHandle>? handles; | |
22 }; | |
23 | |
24 interface Channel { | 19 interface Channel { |
25 Receive(Message message); | 20 Receive(array<uint8> data, array<SerializedHandle>? handles); |
26 }; | 21 }; |
27 | 22 |
28 // An interface for connecting a pair of Channel interfaces representing a | 23 // An interface for connecting a pair of Channel interfaces representing a |
29 // bidirectional IPC channel. | 24 // bidirectional IPC channel. |
30 interface Bootstrap { | 25 interface Bootstrap { |
31 // Initializes a Chrome IPC channel over |to_client_channel| and | 26 // Initializes a Chrome IPC channel over |to_client_channel| and |
32 // |to_server_channel|. Each side also sends its PID to the other side. | 27 // |to_server_channel|. Each side also sends its PID to the other side. |
33 Init(associated Channel& to_client_channel, | 28 Init(associated Channel& to_client_channel, |
34 associated Channel to_server_channel, | 29 associated Channel to_server_channel, |
35 int32 pid) => (int32 pid); | 30 int32 pid) => (int32 pid); |
36 }; | 31 }; |
OLD | NEW |