| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 [JavaPackage="org.chromium.mojo.bindings.pipecontrol"] | 5 [JavaPackage="org.chromium.mojo.bindings.pipecontrol"] |
| 6 module mojo.pipe_control; | 6 module mojo.pipe_control; |
| 7 | 7 |
| 8 // For each message pipe running user-defined interfaces, some control | 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 | 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. | 10 // that they can coordinate to manage interface endpoints. |
| 11 // All these control messages will have the interface ID field in the message | 11 // All these control messages will have the interface ID field in the message |
| 12 // header set to invalid. | 12 // header set to invalid. |
| 13 | 13 |
| 14 //////////////////////////////////////////////////////////////////////////////// | 14 //////////////////////////////////////////////////////////////////////////////// |
| 15 // RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); | 15 // RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); |
| 16 // | 16 // |
| 17 // This control function runs the input command. If the operation fails or the | 17 // This control function runs the input command. If the operation fails or the |
| 18 // command is not supported, the message pipe is closed. | 18 // command is not supported, the message pipe is closed. |
| 19 | 19 |
| 20 const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; | 20 const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; |
| 21 | 21 |
| 22 struct RunOrClosePipeMessageParams { | 22 struct RunOrClosePipeMessageParams { |
| 23 RunOrClosePipeInput input; | 23 RunOrClosePipeInput input; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 union RunOrClosePipeInput { | 26 union RunOrClosePipeInput { |
| 27 PeerAssociatedEndpointClosedEvent peer_associated_endpoint_closed_event; | 27 PeerAssociatedEndpointClosedEvent peer_associated_endpoint_closed_event; |
| 28 AssociatedEndpointClosedBeforeSentEvent | |
| 29 associated_endpoint_closed_before_sent_event; | |
| 30 }; | 28 }; |
| 31 | 29 |
| 32 // A user-defined reason about why the interface is disconnected. | 30 // A user-defined reason about why the interface is disconnected. |
| 33 struct DisconnectReason { | 31 struct DisconnectReason { |
| 34 uint32 custom_reason; | 32 uint32 custom_reason; |
| 35 string description; | 33 string description; |
| 36 }; | 34 }; |
| 37 | 35 |
| 38 // An event to notify that an interface endpoint set up at the message sender | 36 // An event to notify that an interface endpoint set up at the message sender |
| 39 // side has been closed. | 37 // side has been closed. |
| 40 // | 38 // |
| 41 // This event is omitted if the endpoint belongs to the master interface and | 39 // This event is omitted if the endpoint belongs to the master interface and |
| 42 // there is no disconnect reason specified. | 40 // there is no disconnect reason specified. |
| 43 struct PeerAssociatedEndpointClosedEvent { | 41 struct PeerAssociatedEndpointClosedEvent { |
| 44 // The interface ID. | 42 // The interface ID. |
| 45 uint32 id; | 43 uint32 id; |
| 46 DisconnectReason? disconnect_reason; | 44 DisconnectReason? disconnect_reason; |
| 47 }; | 45 }; |
| 48 | 46 |
| 49 // An event to notify that an interface endpoint that is meant to be set up at | |
| 50 // the message receiver side has been closed before sent over the message pipe. | |
| 51 // | |
| 52 // This event is only used for associated interfaces. | |
| 53 struct AssociatedEndpointClosedBeforeSentEvent { | |
| 54 // The interface ID. | |
| 55 uint32 id; | |
| 56 }; | |
| 57 | |
| OLD | NEW |