| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 MojoResult (*WrapPlatformSharedBufferHandle)( | 145 MojoResult (*WrapPlatformSharedBufferHandle)( |
| 146 const struct MojoPlatformHandle* platform_handle, | 146 const struct MojoPlatformHandle* platform_handle, |
| 147 size_t num_bytes, | 147 size_t num_bytes, |
| 148 MojoPlatformSharedBufferHandleFlags flags, | 148 MojoPlatformSharedBufferHandleFlags flags, |
| 149 MojoHandle* mojo_handle); | 149 MojoHandle* mojo_handle); |
| 150 MojoResult (*UnwrapPlatformSharedBufferHandle)( | 150 MojoResult (*UnwrapPlatformSharedBufferHandle)( |
| 151 MojoHandle mojo_handle, | 151 MojoHandle mojo_handle, |
| 152 struct MojoPlatformHandle* platform_handle, | 152 struct MojoPlatformHandle* platform_handle, |
| 153 size_t* num_bytes, | 153 size_t* num_bytes, |
| 154 MojoPlatformSharedBufferHandleFlags* flags); | 154 MojoPlatformSharedBufferHandleFlags* flags); |
| 155 MojoResult (*NotifyBadMessage)(MojoMessageHandle message); |
| 155 }; | 156 }; |
| 156 #pragma pack(pop) | 157 #pragma pack(pop) |
| 157 | 158 |
| 158 | 159 |
| 159 #ifdef __cplusplus | 160 #ifdef __cplusplus |
| 160 // Intended to be called from the embedder. Returns a |MojoCore| initialized | 161 // Intended to be called from the embedder. Returns a |MojoCore| initialized |
| 161 // to contain pointers to each of the embedder's MojoCore functions. | 162 // to contain pointers to each of the embedder's MojoCore functions. |
| 162 inline MojoSystemThunks MojoMakeSystemThunks() { | 163 inline MojoSystemThunks MojoMakeSystemThunks() { |
| 163 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), | 164 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), |
| 164 MojoGetTimeTicksNow, | 165 MojoGetTimeTicksNow, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 187 MojoCancelWatch, | 188 MojoCancelWatch, |
| 188 MojoFuseMessagePipes, | 189 MojoFuseMessagePipes, |
| 189 MojoWriteMessageNew, | 190 MojoWriteMessageNew, |
| 190 MojoReadMessageNew, | 191 MojoReadMessageNew, |
| 191 MojoAllocMessage, | 192 MojoAllocMessage, |
| 192 MojoFreeMessage, | 193 MojoFreeMessage, |
| 193 MojoGetMessageBuffer, | 194 MojoGetMessageBuffer, |
| 194 MojoWrapPlatformHandle, | 195 MojoWrapPlatformHandle, |
| 195 MojoUnwrapPlatformHandle, | 196 MojoUnwrapPlatformHandle, |
| 196 MojoWrapPlatformSharedBufferHandle, | 197 MojoWrapPlatformSharedBufferHandle, |
| 197 MojoUnwrapPlatformSharedBufferHandle}; | 198 MojoUnwrapPlatformSharedBufferHandle, |
| 199 MojoNotifyBadMessage}; |
| 198 return system_thunks; | 200 return system_thunks; |
| 199 } | 201 } |
| 200 #endif | 202 #endif |
| 201 | 203 |
| 202 | 204 |
| 203 // Use this type for the function found by dynamically discovering it in | 205 // Use this type for the function found by dynamically discovering it in |
| 204 // a DSO linked with mojo_system. For example: | 206 // a DSO linked with mojo_system. For example: |
| 205 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = | 207 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
| 206 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( | 208 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
| 207 // "MojoSetSystemThunks")); | 209 // "MojoSetSystemThunks")); |
| 208 // The expected size of |system_thunks} is returned. | 210 // The expected size of |system_thunks} is returned. |
| 209 // The contents of |system_thunks| are copied. | 211 // The contents of |system_thunks| are copied. |
| 210 typedef size_t (*MojoSetSystemThunksFn)( | 212 typedef size_t (*MojoSetSystemThunksFn)( |
| 211 const struct MojoSystemThunks* system_thunks); | 213 const struct MojoSystemThunks* system_thunks); |
| 212 | 214 |
| 213 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 215 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| OLD | NEW |