| 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 // Note: This header should be compilable as C. | 5 // Note: This header should be compilable as C. |
| 6 | 6 |
| 7 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 7 #ifndef MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| 8 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 8 #define MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 uint64_t offset, | 105 uint64_t offset, |
| 106 uint64_t num_bytes, | 106 uint64_t num_bytes, |
| 107 void** buffer, | 107 void** buffer, |
| 108 MojoMapBufferFlags flags); | 108 MojoMapBufferFlags flags); |
| 109 MojoResult (*UnmapBuffer)(void* buffer); | 109 MojoResult (*UnmapBuffer)(void* buffer); |
| 110 // TODO(vtl): The next time an ABI-breaking change is made, re-order the | 110 // TODO(vtl): The next time an ABI-breaking change is made, re-order the |
| 111 // following elements (to match the order in |Core|). | 111 // following elements (to match the order in |Core|). |
| 112 MojoResult (*GetBufferInformation)(MojoHandle buffer_handle, | 112 MojoResult (*GetBufferInformation)(MojoHandle buffer_handle, |
| 113 struct MojoBufferInformation* info, | 113 struct MojoBufferInformation* info, |
| 114 uint32_t info_num_bytes); | 114 uint32_t info_num_bytes); |
| 115 MojoResult (*SetDataPipeConsumerOptions)( |
| 116 MojoHandle data_pipe_consumer_handle, |
| 117 const struct MojoDataPipeConsumerOptions* options); |
| 118 MojoResult (*GetDataPipeConsumerOptions)( |
| 119 MojoHandle data_pipe_consumer_handle, |
| 120 struct MojoDataPipeConsumerOptions* options, |
| 121 uint32_t options_num_bytes); |
| 115 }; | 122 }; |
| 116 #pragma pack(pop) | 123 #pragma pack(pop) |
| 117 | 124 |
| 118 | 125 |
| 119 #ifdef __cplusplus | 126 #ifdef __cplusplus |
| 120 // Intended to be called from the embedder. Returns a |MojoCore| initialized | 127 // Intended to be called from the embedder. Returns a |MojoCore| initialized |
| 121 // to contain pointers to each of the embedder's MojoCore functions. | 128 // to contain pointers to each of the embedder's MojoCore functions. |
| 122 inline MojoSystemThunks MojoMakeSystemThunks() { | 129 inline MojoSystemThunks MojoMakeSystemThunks() { |
| 123 MojoSystemThunks system_thunks = { | 130 MojoSystemThunks system_thunks = { |
| 124 sizeof(MojoSystemThunks), | 131 sizeof(MojoSystemThunks), |
| 125 MojoGetTimeTicksNow, | 132 MojoGetTimeTicksNow, |
| 126 MojoClose, | 133 MojoClose, |
| 127 MojoWait, | 134 MojoWait, |
| 128 MojoWaitMany, | 135 MojoWaitMany, |
| 129 MojoCreateMessagePipe, | 136 MojoCreateMessagePipe, |
| 130 MojoWriteMessage, | 137 MojoWriteMessage, |
| 131 MojoReadMessage, | 138 MojoReadMessage, |
| 132 MojoCreateDataPipe, | 139 MojoCreateDataPipe, |
| 133 MojoWriteData, | 140 MojoWriteData, |
| 134 MojoBeginWriteData, | 141 MojoBeginWriteData, |
| 135 MojoEndWriteData, | 142 MojoEndWriteData, |
| 136 MojoReadData, | 143 MojoReadData, |
| 137 MojoBeginReadData, | 144 MojoBeginReadData, |
| 138 MojoEndReadData, | 145 MojoEndReadData, |
| 139 MojoCreateSharedBuffer, | 146 MojoCreateSharedBuffer, |
| 140 MojoDuplicateBufferHandle, | 147 MojoDuplicateBufferHandle, |
| 141 MojoMapBuffer, | 148 MojoMapBuffer, |
| 142 MojoUnmapBuffer, | 149 MojoUnmapBuffer, |
| 143 MojoGetBufferInformation, | 150 MojoGetBufferInformation, |
| 151 MojoSetDataPipeConsumerOptions, |
| 152 MojoGetDataPipeConsumerOptions, |
| 144 }; | 153 }; |
| 145 return system_thunks; | 154 return system_thunks; |
| 146 } | 155 } |
| 147 #endif | 156 #endif |
| 148 | 157 |
| 149 | 158 |
| 150 // Use this type for the function found by dynamically discovering it in | 159 // Use this type for the function found by dynamically discovering it in |
| 151 // a DSO linked with mojo_system. For example: | 160 // a DSO linked with mojo_system. For example: |
| 152 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = | 161 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
| 153 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( | 162 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
| 154 // "MojoSetSystemThunks")); | 163 // "MojoSetSystemThunks")); |
| 155 // The expected size of |system_thunks} is returned. | 164 // The expected size of |system_thunks} is returned. |
| 156 // The contents of |system_thunks| are copied. | 165 // The contents of |system_thunks| are copied. |
| 157 typedef size_t (*MojoSetSystemThunksFn)( | 166 typedef size_t (*MojoSetSystemThunksFn)( |
| 158 const struct MojoSystemThunks* system_thunks); | 167 const struct MojoSystemThunks* system_thunks); |
| 159 | 168 |
| 160 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 169 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| OLD | NEW |