blob: 9631ce8fd23b46bb4d23821cb4d61e01f8e251a2 [file] [log] [blame]
sammc6194d972016-03-08 07:38:04 +09001// 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
5module IPC.mojom;
6
Ken Rockotfc4fdb22018-07-12 10:37:11 +09007import "mojo/public/mojom/base/big_buffer.mojom";
Eve Martin-Jonesb898f2b2018-02-14 07:57:25 +09008import "mojo/public/interfaces/bindings/native_struct.mojom";
sammc0bcbfc72016-03-10 15:28:35 +09009
rockota6edf832016-07-14 09:34:11 +090010// A placeholder interface type since we don't yet support generic associated
11// message pipe handles.
12interface GenericInterface {};
13
Ken Rockotfc4fdb22018-07-12 10:37:11 +090014// Typemapped such that arbitrarily large IPC::Message objects can be sent and
15// received with minimal copying.
16struct Message {
17 mojo_base.mojom.BigBuffer buffer;
18 array<mojo.native.SerializedHandle>? handles;
19};
20
sammc6194d972016-03-08 07:38:04 +090021interface Channel {
rockota01dbc72016-07-23 06:18:07 +090022 // 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 Rockotfc4fdb22018-07-12 10:37:11 +090027 Receive(Message message);
rockota6edf832016-07-14 09:34:11 +090028
rockota01dbc72016-07-23 06:18:07 +090029 // Requests a Channel-associated interface.
rockota6edf832016-07-14 09:34:11 +090030 GetAssociatedInterface(string name, associated GenericInterface& request);
sammc6194d972016-03-08 07:38:04 +090031};
rockot03821c32016-08-10 01:30:05 +090032
33// A strictly nominal interface used to identify Channel bootstrap requests.
34interface ChannelBootstrap {};
Eve Martin-Jones726c9702018-02-01 11:24:51 +090035