sammc | 6194d97 | 2016-03-08 07:38:04 +0900 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | module IPC.mojom; |
| 6 | |
Ken Rockot | fc4fdb2 | 2018-07-12 10:37:11 +0900 | [diff] [blame] | 7 | import "mojo/public/mojom/base/big_buffer.mojom"; |
Eve Martin-Jones | b898f2b | 2018-02-14 07:57:25 +0900 | [diff] [blame] | 8 | import "mojo/public/interfaces/bindings/native_struct.mojom"; |
sammc | 0bcbfc7 | 2016-03-10 15:28:35 +0900 | [diff] [blame] | 9 | |
rockot | a6edf83 | 2016-07-14 09:34:11 +0900 | [diff] [blame] | 10 | // A placeholder interface type since we don't yet support generic associated |
| 11 | // message pipe handles. |
| 12 | interface GenericInterface {}; |
| 13 | |
Ken Rockot | fc4fdb2 | 2018-07-12 10:37:11 +0900 | [diff] [blame] | 14 | // Typemapped such that arbitrarily large IPC::Message objects can be sent and |
| 15 | // received with minimal copying. |
| 16 | struct Message { |
| 17 | mojo_base.mojom.BigBuffer buffer; |
| 18 | array<mojo.native.SerializedHandle>? handles; |
| 19 | }; |
| 20 | |
sammc | 6194d97 | 2016-03-08 07:38:04 +0900 | [diff] [blame] | 21 | interface Channel { |
rockot | a01dbc7 | 2016-07-23 06:18:07 +0900 | [diff] [blame] | 22 | // Informs the remote end of this client's PID. Must be called exactly once, |
| 23 | // before any calls to Receive() below. |
| 24 | SetPeerPid(int32 pid); |
| 25 | |
| 26 | // Transmits a classical Chrome IPC message. |
Ken Rockot | fc4fdb2 | 2018-07-12 10:37:11 +0900 | [diff] [blame] | 27 | Receive(Message message); |
rockot | a6edf83 | 2016-07-14 09:34:11 +0900 | [diff] [blame] | 28 | |
rockot | a01dbc7 | 2016-07-23 06:18:07 +0900 | [diff] [blame] | 29 | // Requests a Channel-associated interface. |
rockot | a6edf83 | 2016-07-14 09:34:11 +0900 | [diff] [blame] | 30 | GetAssociatedInterface(string name, associated GenericInterface& request); |
sammc | 6194d97 | 2016-03-08 07:38:04 +0900 | [diff] [blame] | 31 | }; |
rockot | 03821c3 | 2016-08-10 01:30:05 +0900 | [diff] [blame] | 32 | |
| 33 | // A strictly nominal interface used to identify Channel bootstrap requests. |
| 34 | interface ChannelBootstrap {}; |
Eve Martin-Jones | 726c970 | 2018-02-01 11:24:51 +0900 | [diff] [blame] | 35 | |