diff options
Diffstat (limited to 'mojo/public/interfaces/bindings/new_bindings')
-rw-r--r-- | mojo/public/interfaces/bindings/new_bindings/interface_control_messages.mojom | 67 | ||||
-rw-r--r-- | mojo/public/interfaces/bindings/new_bindings/pipe_control_messages.mojom | 46 |
2 files changed, 113 insertions, 0 deletions
diff --git a/mojo/public/interfaces/bindings/new_bindings/interface_control_messages.mojom b/mojo/public/interfaces/bindings/new_bindings/interface_control_messages.mojom new file mode 100644 index 0000000000..e03ffd6589 --- /dev/null +++ b/mojo/public/interfaces/bindings/new_bindings/interface_control_messages.mojom @@ -0,0 +1,67 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.interfacecontrol"] +module mojo.interface_control2; + +// For each user-defined interface, some control functions are provided by the +// interface endpoints at both sides. + +//////////////////////////////////////////////////////////////////////////////// +// Run@0xFFFFFFFF(RunInput input) => (RunOutput? output); +// +// This control function runs the input command. If the command is not +// supported, |output| is set to null; otherwise |output| stores the result, +// whose type depends on the input. + +const uint32 kRunMessageId = 0xFFFFFFFF; + +struct RunMessageParams { + RunInput input; +}; +union RunInput { + QueryVersion query_version; + FlushForTesting flush_for_testing; +}; + +struct RunResponseMessageParams { + RunOutput? output; +}; +union RunOutput { + QueryVersionResult query_version_result; +}; + +// Queries the max supported version of the user-defined interface. +// Sent by the interface client side. +struct QueryVersion { +}; +struct QueryVersionResult { + uint32 version; +}; + +// Sent by either side of the interface. +struct FlushForTesting { +}; + +//////////////////////////////////////////////////////////////////////////////// +// RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); +// +// This control function runs the input command. If the operation fails or the +// command is not supported, the message pipe is closed. + +const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; + +struct RunOrClosePipeMessageParams { + RunOrClosePipeInput input; +}; +union RunOrClosePipeInput { + RequireVersion require_version; +}; + +// If the specified version of the user-defined interface is not supported, the +// function fails and the pipe is closed. +// Sent by the interface client side. +struct RequireVersion { + uint32 version; +}; diff --git a/mojo/public/interfaces/bindings/new_bindings/pipe_control_messages.mojom b/mojo/public/interfaces/bindings/new_bindings/pipe_control_messages.mojom new file mode 100644 index 0000000000..69975fc1c0 --- /dev/null +++ b/mojo/public/interfaces/bindings/new_bindings/pipe_control_messages.mojom @@ -0,0 +1,46 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +[JavaPackage="org.chromium.mojo.bindings.pipecontrol"] +module mojo.pipe_control2; + +// For each message pipe running user-defined interfaces, some control +// functions are provided and used by the routers at both ends of the pipe, so +// that they can coordinate to manage interface endpoints. +// All these control messages will have the interface ID field in the message +// header set to invalid. + +//////////////////////////////////////////////////////////////////////////////// +// RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); +// +// This control function runs the input command. If the operation fails or the +// command is not supported, the message pipe is closed. + +const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; + +struct RunOrClosePipeMessageParams { + RunOrClosePipeInput input; +}; + +union RunOrClosePipeInput { + PeerAssociatedEndpointClosedEvent peer_associated_endpoint_closed_event; +}; + +// A user-defined reason about why the interface is disconnected. +struct DisconnectReason { + uint32 custom_reason; + string description; +}; + +// An event to notify that an interface endpoint set up at the message sender +// side has been closed. +// +// This event is omitted if the endpoint belongs to the master interface and +// there is no disconnect reason specified. +struct PeerAssociatedEndpointClosedEvent { + // The interface ID. + uint32 id; + DisconnectReason? disconnect_reason; +}; + |