| OLD | NEW |
| (Empty) |
| 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 [DartPackage="mojo", | |
| 6 JavaPackage="org.chromium.mojo.bindings"] | |
| 7 module mojo; | |
| 8 | |
| 9 // For each message pipe representing a user-defined interface, some control | |
| 10 // functions are provided at the same end of the message pipe as the | |
| 11 // user-defined interface, providing information about the user-defined | |
| 12 // interface and controlling behavior of the message pipe. | |
| 13 | |
| 14 //////////////////////////////////////////////////////////////////////////////// | |
| 15 // Run@0xFFFFFFFF(RunInput input) => (RunOutput? output); | |
| 16 // | |
| 17 // This control function runs the input command. If the command is not | |
| 18 // supported, |output| is set to null; otherwise |output| stores the result, | |
| 19 // whose type depends on the input. | |
| 20 // | |
| 21 // TODO(yzshen): Once union support is ready, switch the following definition | |
| 22 // to: | |
| 23 // struct RunMessageParams { | |
| 24 // RunInput input; | |
| 25 // }; | |
| 26 // union RunInput { | |
| 27 // QueryVersion query_version; | |
| 28 // }; | |
| 29 // | |
| 30 // struct RunResponseMessageParams { | |
| 31 // RunOutput? output; | |
| 32 // }; | |
| 33 // union RunOutput { | |
| 34 // QueryVersionResult query_version_result; | |
| 35 // }; | |
| 36 | |
| 37 const uint32 kRunMessageId = 0xFFFFFFFF; | |
| 38 | |
| 39 struct RunMessageParams { | |
| 40 // The reserved fields make the layout compatible with the RunInput union | |
| 41 // described above. | |
| 42 uint32 reserved0; // Must be set to 16. | |
| 43 uint32 reserved1; // Must be set to 0; | |
| 44 QueryVersion query_version; | |
| 45 }; | |
| 46 | |
| 47 struct RunResponseMessageParams { | |
| 48 // The reserved fields make the layout compatible with the RunOutput union | |
| 49 // described above. | |
| 50 uint32 reserved0; // Must be set to 16. | |
| 51 uint32 reserved1; // Must be set to 0. | |
| 52 QueryVersionResult query_version_result; | |
| 53 }; | |
| 54 | |
| 55 // Queries the max supported version of the user-defined interface. | |
| 56 struct QueryVersion {}; | |
| 57 struct QueryVersionResult { | |
| 58 uint32 version; | |
| 59 }; | |
| 60 | |
| 61 //////////////////////////////////////////////////////////////////////////////// | |
| 62 // RunOrClosePipe@0xFFFFFFFE(RunOrClosePipeInput input); | |
| 63 // | |
| 64 // This control function runs the input command. If the operation fails or the | |
| 65 // command is not supported, the message pipe is closed. | |
| 66 // | |
| 67 // TODO(yzshen): Once union support is ready, switch the following definition | |
| 68 // to: | |
| 69 // struct RunOrClosePipeMessageParams { | |
| 70 // RunOrClosePipeInput input; | |
| 71 // }; | |
| 72 // union RunOrClosePipeInput { | |
| 73 // RequireVersion require_version; | |
| 74 // }; | |
| 75 | |
| 76 const uint32 kRunOrClosePipeMessageId = 0xFFFFFFFE; | |
| 77 | |
| 78 struct RunOrClosePipeMessageParams { | |
| 79 // The reserved fields make the layout compatible with the RunOrClosePipeInput | |
| 80 // union described above. | |
| 81 uint32 reserved0; // Must be set to 16. | |
| 82 uint32 reserved1; // Must be set to 0. | |
| 83 RequireVersion require_version; | |
| 84 }; | |
| 85 | |
| 86 // If the specified version of the user-defined interface is not supported, the | |
| 87 // function fails and the pipe is closed. | |
| 88 struct RequireVersion { | |
| 89 uint32 version; | |
| 90 }; | |
| OLD | NEW |