OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/constants and functions specific to buffers (and in | 5 // This file contains types/constants and functions specific to buffers (and in |
6 // particular shared buffers). | 6 // particular shared buffers). |
7 // TODO(vtl): Reorganize this file (etc.) to separate general buffer functions | 7 // TODO(vtl): Reorganize this file (etc.) to separate general buffer functions |
8 // from (shared) buffer creation. | 8 // from (shared) buffer creation. |
9 // | 9 // |
10 // Note: This header should be compilable as C. | 10 // Note: This header should be compilable as C. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 typedef uint32_t MojoDuplicateBufferHandleOptionsFlags; | 65 typedef uint32_t MojoDuplicateBufferHandleOptionsFlags; |
66 | 66 |
67 #ifdef __cplusplus | 67 #ifdef __cplusplus |
68 const MojoDuplicateBufferHandleOptionsFlags | 68 const MojoDuplicateBufferHandleOptionsFlags |
69 MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE = 0; | 69 MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE = 0; |
70 const MojoDuplicateBufferHandleOptionsFlags | 70 const MojoDuplicateBufferHandleOptionsFlags |
71 MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY = 1 << 0; | 71 MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY = 1 << 0; |
72 #else | 72 #else |
73 #define MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE \ | 73 #define MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE \ |
74 ((MojoDuplicateBufferHandleOptionsFlags)0) | 74 ((MojoDuplicateBufferHandleOptionsFlags)0) |
| 75 #define MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY \ |
| 76 ((MojoDuplicateBufferHandleOptionsFlags)1 << 0) |
75 #endif | 77 #endif |
76 | 78 |
77 struct MojoDuplicateBufferHandleOptions { | 79 struct MojoDuplicateBufferHandleOptions { |
78 uint32_t struct_size; | 80 uint32_t struct_size; |
79 MojoDuplicateBufferHandleOptionsFlags flags; | 81 MojoDuplicateBufferHandleOptionsFlags flags; |
80 }; | 82 }; |
81 MOJO_STATIC_ASSERT(sizeof(MojoDuplicateBufferHandleOptions) == 8, | 83 MOJO_STATIC_ASSERT(sizeof(MojoDuplicateBufferHandleOptions) == 8, |
82 "MojoDuplicateBufferHandleOptions has wrong size"); | 84 "MojoDuplicateBufferHandleOptions has wrong size"); |
83 | 85 |
84 // |MojoMapBufferFlags|: Used to specify different modes to |MojoMapBuffer()|. | 86 // |MojoMapBufferFlags|: Used to specify different modes to |MojoMapBuffer()|. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // |MOJO_RESULT_OK| on success. | 186 // |MOJO_RESULT_OK| on success. |
185 // |MOJO_RESULT_INVALID_ARGUMENT| if |buffer| is invalid (e.g., is not the | 187 // |MOJO_RESULT_INVALID_ARGUMENT| if |buffer| is invalid (e.g., is not the |
186 // result of |MojoMapBuffer()| or has already been unmapped). | 188 // result of |MojoMapBuffer()| or has already been unmapped). |
187 MOJO_SYSTEM_EXPORT MojoResult MojoUnmapBuffer(void* buffer); // In. | 189 MOJO_SYSTEM_EXPORT MojoResult MojoUnmapBuffer(void* buffer); // In. |
188 | 190 |
189 #ifdef __cplusplus | 191 #ifdef __cplusplus |
190 } // extern "C" | 192 } // extern "C" |
191 #endif | 193 #endif |
192 | 194 |
193 #endif // MOJO_PUBLIC_C_SYSTEM_BUFFER_H_ | 195 #endif // MOJO_PUBLIC_C_SYSTEM_BUFFER_H_ |
OLD | NEW |