| 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.interfacecontrol"] | 5 [JavaPackage="org.chromium.mojo.bindings.interfacecontrol"] |
| 6 module mojo.interface_control; | 6 module mojo.interface_control; |
| 7 | 7 |
| 8 // For each user-defined interface, some control functions are provided at the | 8 // For each user-defined interface, some control functions are provided at the |
| 9 // same end of the message pipe as the user-defined interface, providing | 9 // same end of the message pipe as the user-defined interface, providing |
| 10 // information about the user-defined interface. | 10 // information about the user-defined interface. |
| 11 | 11 |
| 12 //////////////////////////////////////////////////////////////////////////////// | 12 //////////////////////////////////////////////////////////////////////////////// |
| 13 // Run@0xFFFFFFFF(RunInput input) => (RunOutput? output); | 13 // Run@0xFFFFFFFF(RunInput input) => (RunOutput? output); |
| 14 // | 14 // |
| 15 // This control function runs the input command. If the command is not | 15 // This control function runs the input command. If the command is not |
| 16 // supported, |output| is set to null; otherwise |output| stores the result, | 16 // supported, |output| is set to null; otherwise |output| stores the result, |
| 17 // whose type depends on the input. | 17 // whose type depends on the input. |
| 18 | 18 |
| 19 const uint32 kRunMessageId = 0xFFFFFFFF; | 19 const uint32 kRunMessageId = 0xFFFFFFFF; |
| 20 | 20 |
| 21 struct RunMessageParams { | 21 struct RunMessageParams { |
| 22 RunInput input; | 22 RunInput input; |
| 23 }; | 23 }; |
| 24 union RunInput { | 24 union RunInput { |
| 25 QueryVersion query_version; | 25 QueryVersion query_version; |
| 26 FlushForTesting flush_for_testing; |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 struct RunResponseMessageParams { | 29 struct RunResponseMessageParams { |
| 29 RunOutput? output; | 30 RunOutput? output; |
| 30 }; | 31 }; |
| 31 union RunOutput { | 32 union RunOutput { |
| 32 QueryVersionResult query_version_result; | 33 QueryVersionResult query_version_result; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 // Queries the max supported version of the user-defined interface. | 36 // Queries the max supported version of the user-defined interface. |
| 36 struct QueryVersion { | 37 struct QueryVersion { |
| 37 }; | 38 }; |
| 38 struct QueryVersionResult { | 39 struct QueryVersionResult { |
| 39 uint32 version; | 40 uint32 version; |
| 40 }; | 41 }; |
| 41 | 42 |
| 43 struct FlushForTesting { |
| 44 }; |
| 45 |
| 42 //////////////////////////////////////////////////////////////////////////////// | 46 //////////////////////////////////////////////////////////////////////////////// |
| 43 // RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); | 47 // RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); |
| 44 // | 48 // |
| 45 // This control function runs the input command. If the operation fails or the | 49 // This control function runs the input command. If the operation fails or the |
| 46 // command is not supported, the message pipe is closed. | 50 // command is not supported, the message pipe is closed. |
| 47 | 51 |
| 48 const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; | 52 const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; |
| 49 | 53 |
| 50 struct RunOrClosePipeMessageParams { | 54 struct RunOrClosePipeMessageParams { |
| 51 RunOrClosePipeInput input; | 55 RunOrClosePipeInput input; |
| 52 }; | 56 }; |
| 53 union RunOrClosePipeInput { | 57 union RunOrClosePipeInput { |
| 54 RequireVersion require_version; | 58 RequireVersion require_version; |
| 55 }; | 59 }; |
| 56 | 60 |
| 57 // If the specified version of the user-defined interface is not supported, the | 61 // If the specified version of the user-defined interface is not supported, the |
| 58 // function fails and the pipe is closed. | 62 // function fails and the pipe is closed. |
| 59 struct RequireVersion { | 63 struct RequireVersion { |
| 60 uint32 version; | 64 uint32 version; |
| 61 }; | 65 }; |
| OLD | NEW |