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 types/functions and constants for platform handle wrapping | 5 // This file contains types/functions and constants for platform handle wrapping |
6 // and unwrapping APIs. | 6 // and unwrapping APIs. |
7 // | 7 // |
8 // Note: This header should be compilable as C. | 8 // Note: This header should be compilable as C. |
9 | 9 |
10 #ifndef MOJO_PUBLIC_C_SYSTEM_PLATFORM_HANDLE_H_ | 10 #ifndef MOJO_PUBLIC_C_SYSTEM_PLATFORM_HANDLE_H_ |
(...skipping 20 matching lines...) Expand all Loading... |
31 // |MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE| - A Windows HANDLE value. Only | 31 // |MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE| - A Windows HANDLE value. Only |
32 // valid on Windows. | 32 // valid on Windows. |
33 | 33 |
34 typedef uint32_t MojoPlatformHandleType; | 34 typedef uint32_t MojoPlatformHandleType; |
35 | 35 |
36 #ifdef __cplusplus | 36 #ifdef __cplusplus |
37 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_INVALID = 0; | 37 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_INVALID = 0; |
38 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_FILE_DESCRIPTOR = 1; | 38 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_FILE_DESCRIPTOR = 1; |
39 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_MACH_PORT = 2; | 39 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_MACH_PORT = 2; |
40 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE = 3; | 40 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE = 3; |
| 41 const MojoPlatformHandleType MOJO_PLATFORM_HANDLE_TYPE_PARCELABLE = 4; |
41 #else | 42 #else |
42 #define MOJO_PLATFORM_HANDLE_TYPE_INVALID ((MojoPlatformHandleType)0) | 43 #define MOJO_PLATFORM_HANDLE_TYPE_INVALID ((MojoPlatformHandleType)0) |
43 #define MOJO_PLATFORM_HANDLE_TYPE_FILE_DESCRIPTOR ((MojoPlatformHandleType)1) | 44 #define MOJO_PLATFORM_HANDLE_TYPE_FILE_DESCRIPTOR ((MojoPlatformHandleType)1) |
44 #define MOJO_PLATFORM_HANDLE_TYPE_MACH_PORT ((MojoPlatformHandleType)2) | 45 #define MOJO_PLATFORM_HANDLE_TYPE_MACH_PORT ((MojoPlatformHandleType)2) |
45 #define MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE ((MojoPlatformHandleType)3) | 46 #define MOJO_PLATFORM_HANDLE_TYPE_WINDOWS_HANDLE ((MojoPlatformHandleType)3) |
| 47 #define MOJO_PLATFORM_HANDLE_TYPE_PARCELABLE ((MojoPlatformHandleType)4) |
| 48 |
46 #endif | 49 #endif |
47 | 50 |
48 // |MojoPlatformHandle|: A handle to an OS object. | 51 // |MojoPlatformHandle|: A handle to an OS object. |
49 // |uint32_t struct_size|: The size of this structure. Used for versioning | 52 // |uint32_t struct_size|: The size of this structure. Used for versioning |
50 // to allow for future extensions. | 53 // to allow for future extensions. |
51 // |MojoPlatformHandleType type|: The type of handle stored in |value|. | 54 // |MojoPlatformHandleType type|: The type of handle stored in |value|. |
52 // |uint64_t value|: The value of this handle. Ignored if |type| is | 55 // |uint64_t value|: The value of this handle. Ignored if |type| is |
53 // MOJO_PLATFORM_HANDLE_TYPE_INVALID. | 56 // MOJO_PLATFORM_HANDLE_TYPE_INVALID. |
54 // | 57 // |
55 | 58 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 MojoHandle mojo_handle, | 178 MojoHandle mojo_handle, |
176 struct MojoPlatformHandle* platform_handle, | 179 struct MojoPlatformHandle* platform_handle, |
177 size_t* num_bytes, | 180 size_t* num_bytes, |
178 MojoPlatformSharedBufferHandleFlags* flags); | 181 MojoPlatformSharedBufferHandleFlags* flags); |
179 | 182 |
180 #ifdef __cplusplus | 183 #ifdef __cplusplus |
181 } // extern "C" | 184 } // extern "C" |
182 #endif | 185 #endif |
183 | 186 |
184 #endif // MOJO_PUBLIC_C_SYSTEM_PLATFORM_HANDLE_H_ | 187 #endif // MOJO_PUBLIC_C_SYSTEM_PLATFORM_HANDLE_H_ |
OLD | NEW |