Home | History | Annotate | Download | only in ipc
      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 
      7 // NOTE: This MUST match the value of MSG_ROUTING_NONE in src/ipc/ipc_message.h.
      8 const int32 kRoutingIdNone = -2;
      9 
     10 struct SerializedHandle {
     11   handle the_handle;
     12 
     13   enum Type {
     14     MOJO_HANDLE,
     15     PLATFORM_FILE,
     16     WIN_HANDLE,
     17     MACH_PORT,
     18   };
     19 
     20   Type type;
     21 };
     22 
     23 // A placeholder interface type since we don't yet support generic associated
     24 // message pipe handles.
     25 interface GenericInterface {};
     26 
     27 interface Channel {
     28   // Informs the remote end of this client's PID. Must be called exactly once,
     29   // before any calls to Receive() below.
     30   SetPeerPid(int32 pid);
     31 
     32   // Transmits a classical Chrome IPC message.
     33   Receive(array<uint8> data, array<SerializedHandle>? handles);
     34 
     35   // Requests a Channel-associated interface.
     36   GetAssociatedInterface(string name, associated GenericInterface& request);
     37 };
     38 
     39 // A strictly nominal interface used to identify Channel bootstrap requests.
     40 interface ChannelBootstrap {};
     41