Home | History | Annotate | Download | only in bindings
      1 // Copyright 2015 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 [JavaPackage="org.chromium.mojo.bindings.pipecontrol"]
      6 module mojo.pipe_control;
      7 
      8 // For each message pipe running user-defined interfaces, some control
      9 // functions are provided and used by the routers at both ends of the pipe, so
     10 // that they can coordinate to manage interface endpoints.
     11 // All these control messages will have the interface ID field in the message
     12 // header set to invalid.
     13 
     14 ////////////////////////////////////////////////////////////////////////////////
     15 // RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input);
     16 //
     17 // This control function runs the input command. If the operation fails or the
     18 // command is not supported, the message pipe is closed.
     19 
     20 const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE;
     21 
     22 struct RunOrClosePipeMessageParams {
     23   RunOrClosePipeInput input;
     24 };
     25 
     26 union RunOrClosePipeInput {
     27   PeerAssociatedEndpointClosedEvent peer_associated_endpoint_closed_event;
     28 };
     29 
     30 // A user-defined reason about why the interface is disconnected.
     31 struct DisconnectReason {
     32   uint32 custom_reason;
     33   string description;
     34 };
     35 
     36 // An event to notify that an interface endpoint set up at the message sender
     37 // side has been closed.
     38 //
     39 // This event is omitted if the endpoint belongs to the master interface and
     40 // there is no disconnect reason specified.
     41 struct PeerAssociatedEndpointClosedEvent {
     42   // The interface ID.
     43   uint32 id;
     44   DisconnectReason? disconnect_reason;
     45 };
     46 
     47