| 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_C_SYSTEM_THUNKS_H_ | 7 #ifndef MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ |
| 8 #define MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ | 8 #define MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 MojoResult (*WrapPlatformSharedBufferHandle)( | 146 MojoResult (*WrapPlatformSharedBufferHandle)( |
| 147 const struct MojoPlatformHandle* platform_handle, | 147 const struct MojoPlatformHandle* platform_handle, |
| 148 size_t num_bytes, | 148 size_t num_bytes, |
| 149 MojoPlatformSharedBufferHandleFlags flags, | 149 MojoPlatformSharedBufferHandleFlags flags, |
| 150 MojoHandle* mojo_handle); | 150 MojoHandle* mojo_handle); |
| 151 MojoResult (*UnwrapPlatformSharedBufferHandle)( | 151 MojoResult (*UnwrapPlatformSharedBufferHandle)( |
| 152 MojoHandle mojo_handle, | 152 MojoHandle mojo_handle, |
| 153 struct MojoPlatformHandle* platform_handle, | 153 struct MojoPlatformHandle* platform_handle, |
| 154 size_t* num_bytes, | 154 size_t* num_bytes, |
| 155 MojoPlatformSharedBufferHandleFlags* flags); | 155 MojoPlatformSharedBufferHandleFlags* flags); |
| 156 MojoResult (*NotifyBadMessage)(MojoMessageHandle message, |
| 157 const char* error, |
| 158 size_t error_num_bytes); |
| 156 }; | 159 }; |
| 157 #pragma pack(pop) | 160 #pragma pack(pop) |
| 158 | 161 |
| 159 // Use this type for the function found by dynamically discovering it in | 162 // Use this type for the function found by dynamically discovering it in |
| 160 // a DSO linked with mojo_system. For example: | 163 // a DSO linked with mojo_system. For example: |
| 161 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = | 164 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
| 162 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( | 165 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
| 163 // "MojoSetSystemThunks")); | 166 // "MojoSetSystemThunks")); |
| 164 // The expected size of |system_thunks| is returned. | 167 // The expected size of |system_thunks| is returned. |
| 165 // The contents of |system_thunks| are copied. | 168 // The contents of |system_thunks| are copied. |
| 166 typedef size_t (*MojoSetSystemThunksFn)( | 169 typedef size_t (*MojoSetSystemThunksFn)( |
| 167 const struct MojoSystemThunks* system_thunks); | 170 const struct MojoSystemThunks* system_thunks); |
| 168 | 171 |
| 169 // A function for setting up the embedder's own system thunks. This should only | 172 // A function for setting up the embedder's own system thunks. This should only |
| 170 // be called by Mojo embedder code. | 173 // be called by Mojo embedder code. |
| 171 MOJO_SYSTEM_EXPORT size_t MojoEmbedderSetSystemThunks( | 174 MOJO_SYSTEM_EXPORT size_t MojoEmbedderSetSystemThunks( |
| 172 const struct MojoSystemThunks* system_thunks); | 175 const struct MojoSystemThunks* system_thunks); |
| 173 | 176 |
| 174 #endif // MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ | 177 #endif // MOJO_PUBLIC_C_SYSTEM_THUNKS_H_ |
| OLD | NEW |