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. |
(...skipping 11 matching lines...) Expand all Loading... |
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 | 28 AssociatedEndpointClosedBeforeSentEvent |
29 associated_endpoint_closed_before_sent_event; | 29 associated_endpoint_closed_before_sent_event; |
30 }; | 30 }; |
31 | 31 |
| 32 // A user-defined reason about why the interface is disconnected. |
| 33 struct DisconnectReason { |
| 34 uint32 custom_reason; |
| 35 string description; |
| 36 }; |
| 37 |
32 // An event to notify that an interface endpoint set up at the message sender | 38 // An event to notify that an interface endpoint set up at the message sender |
33 // side has been closed. | 39 // side has been closed. |
34 // | 40 // |
35 // This event is only used for associated interfaces. When a master interface | 41 // This event is omitted if the endpoint belongs to the master interface and |
36 // is closed, the message pipe is shutdown directly. | 42 // there is no disconnect reason specified. |
37 struct PeerAssociatedEndpointClosedEvent { | 43 struct PeerAssociatedEndpointClosedEvent { |
38 // The interface ID. | 44 // The interface ID. |
39 uint32 id; | 45 uint32 id; |
| 46 DisconnectReason? disconnect_reason; |
40 }; | 47 }; |
41 | 48 |
42 // An event to notify that an interface endpoint that is meant to be set up at | 49 // An event to notify that an interface endpoint that is meant to be set up at |
43 // the message receiver side has been closed before sent over the message pipe. | 50 // the message receiver side has been closed before sent over the message pipe. |
44 // | 51 // |
45 // This event is only used for associated interfaces. | 52 // This event is only used for associated interfaces. |
46 struct AssociatedEndpointClosedBeforeSentEvent { | 53 struct AssociatedEndpointClosedBeforeSentEvent { |
47 // The interface ID. | 54 // The interface ID. |
48 uint32 id; | 55 uint32 id; |
49 }; | 56 }; |
50 | 57 |
OLD | NEW |