| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // This file contains Mojo system handle-related declarations/definitions. | 5 // This file contains Mojo system handle-related declarations/definitions. |
| 6 // | 6 // |
| 7 // Note: This header should be compilable as C. | 7 // Note: This header should be compilable as C. |
| 8 | 8 |
| 9 #ifndef MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |
| 10 #define MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // |MOJO_RESULT_FAILED_PRECONDITION|, you can use this field to | 87 // |MOJO_RESULT_FAILED_PRECONDITION|, you can use this field to |
| 88 // determine which, if any, of the signals can still be satisfied. | 88 // determine which, if any, of the signals can still be satisfied. |
| 89 // Note: This struct is not extensible (and only has 32-bit quantities), so it's | 89 // Note: This struct is not extensible (and only has 32-bit quantities), so it's |
| 90 // 32-bit-aligned. | 90 // 32-bit-aligned. |
| 91 | 91 |
| 92 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(uint32_t) == 4, "uint32_t has weird alignment"); | 92 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(uint32_t) == 4, "uint32_t has weird alignment"); |
| 93 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { | 93 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { |
| 94 MojoHandleSignals satisfied_signals; | 94 MojoHandleSignals satisfied_signals; |
| 95 MojoHandleSignals satisfiable_signals; | 95 MojoHandleSignals satisfiable_signals; |
| 96 }; | 96 }; |
| 97 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, | 97 MOJO_STATIC_ASSERT(sizeof(struct MojoHandleSignalsState) == 8, |
| 98 "MojoHandleSignalsState has wrong size"); | 98 "MojoHandleSignalsState has wrong size"); |
| 99 | 99 |
| 100 MOJO_BEGIN_EXTERN_C | 100 MOJO_BEGIN_EXTERN_C |
| 101 | 101 |
| 102 // |MojoClose()|: Closes the given |handle|. | 102 // |MojoClose()|: Closes the given |handle|. |
| 103 // | 103 // |
| 104 // Returns: | 104 // Returns: |
| 105 // |MOJO_RESULT_OK| on success. | 105 // |MOJO_RESULT_OK| on success. |
| 106 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle. | 106 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle. |
| 107 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction | 107 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // been reached. | 196 // been reached. |
| 197 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction | 197 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction |
| 198 // (that, e.g., may result in it being invalidated, such as being sent in | 198 // (that, e.g., may result in it being invalidated, such as being sent in |
| 199 // a message). | 199 // a message). |
| 200 MojoResult MojoDuplicateHandle(MojoHandle handle, | 200 MojoResult MojoDuplicateHandle(MojoHandle handle, |
| 201 MojoHandle* new_handle); // Out. | 201 MojoHandle* new_handle); // Out. |
| 202 | 202 |
| 203 MOJO_END_EXTERN_C | 203 MOJO_END_EXTERN_C |
| 204 | 204 |
| 205 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ | 205 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ |
| OLD | NEW |