| 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 20 matching lines...) Expand all Loading... |
| 31 typedef uint32_t MojoCreateSharedBufferOptionsFlags; | 31 typedef uint32_t MojoCreateSharedBufferOptionsFlags; |
| 32 | 32 |
| 33 #ifdef __cplusplus | 33 #ifdef __cplusplus |
| 34 const MojoCreateSharedBufferOptionsFlags | 34 const MojoCreateSharedBufferOptionsFlags |
| 35 MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE = 0; | 35 MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE = 0; |
| 36 #else | 36 #else |
| 37 #define MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE \ | 37 #define MOJO_CREATE_SHARED_BUFFER_OPTIONS_FLAG_NONE \ |
| 38 ((MojoCreateSharedBufferOptionsFlags) 0) | 38 ((MojoCreateSharedBufferOptionsFlags) 0) |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 struct MojoCreateSharedBufferOptions { | 41 MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment); |
| 42 struct MOJO_ALIGNAS(8) MojoCreateSharedBufferOptions { |
| 42 uint32_t struct_size; | 43 uint32_t struct_size; |
| 43 MojoCreateSharedBufferOptionsFlags flags; | 44 MojoCreateSharedBufferOptionsFlags flags; |
| 44 }; | 45 }; |
| 45 MOJO_COMPILE_ASSERT(sizeof(MojoCreateSharedBufferOptions) == 8, | 46 MOJO_COMPILE_ASSERT(sizeof(MojoCreateSharedBufferOptions) == 8, |
| 46 MojoCreateSharedBufferOptions_has_wrong_size); | 47 MojoCreateSharedBufferOptions_has_wrong_size); |
| 47 | 48 |
| 48 // |MojoDuplicateBufferHandleOptions|: Used to specify parameters in duplicating | 49 // |MojoDuplicateBufferHandleOptions|: Used to specify parameters in duplicating |
| 49 // access to a shared buffer to |MojoDuplicateBufferHandle()|. | 50 // access to a shared buffer to |MojoDuplicateBufferHandle()|. |
| 50 // |uint32_t struct_size|: Set to the size of the | 51 // |uint32_t struct_size|: Set to the size of the |
| 51 // |MojoDuplicateBufferHandleOptions| struct. (Used to allow for future | 52 // |MojoDuplicateBufferHandleOptions| struct. (Used to allow for future |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 133 |
| 133 // Unmap a buffer pointer that was mapped by |MojoMapBuffer()|. | 134 // Unmap a buffer pointer that was mapped by |MojoMapBuffer()|. |
| 134 // TODO(vtl): More. | 135 // TODO(vtl): More. |
| 135 MOJO_SYSTEM_EXPORT MojoResult MojoUnmapBuffer(void* buffer); // In. | 136 MOJO_SYSTEM_EXPORT MojoResult MojoUnmapBuffer(void* buffer); // In. |
| 136 | 137 |
| 137 #ifdef __cplusplus | 138 #ifdef __cplusplus |
| 138 } // extern "C" | 139 } // extern "C" |
| 139 #endif | 140 #endif |
| 140 | 141 |
| 141 #endif // MOJO_PUBLIC_C_SYSTEM_BUFFER_H_ | 142 #endif // MOJO_PUBLIC_C_SYSTEM_BUFFER_H_ |
| OLD | NEW |