| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 MojoResult (*GetReadyHandles)(MojoHandle wait_set, | 112 MojoResult (*GetReadyHandles)(MojoHandle wait_set, |
| 113 uint32_t* count, | 113 uint32_t* count, |
| 114 MojoHandle* handles, | 114 MojoHandle* handles, |
| 115 MojoResult* results, | 115 MojoResult* results, |
| 116 struct MojoHandleSignalsState* signals_states); | 116 struct MojoHandleSignalsState* signals_states); |
| 117 MojoResult (*Watch)(MojoHandle handle, | 117 MojoResult (*Watch)(MojoHandle handle, |
| 118 MojoHandleSignals signals, | 118 MojoHandleSignals signals, |
| 119 MojoWatchCallback callback, | 119 MojoWatchCallback callback, |
| 120 uintptr_t context); | 120 uintptr_t context); |
| 121 MojoResult (*CancelWatch)(MojoHandle handle, uintptr_t context); | 121 MojoResult (*CancelWatch)(MojoHandle handle, uintptr_t context); |
| 122 MojoResult (*FuseMessagePipes)(MojoHandle handle0, MojoHandle handle1); |
| 122 }; | 123 }; |
| 123 #pragma pack(pop) | 124 #pragma pack(pop) |
| 124 | 125 |
| 125 | 126 |
| 126 #ifdef __cplusplus | 127 #ifdef __cplusplus |
| 127 // Intended to be called from the embedder. Returns a |MojoCore| initialized | 128 // Intended to be called from the embedder. Returns a |MojoCore| initialized |
| 128 // to contain pointers to each of the embedder's MojoCore functions. | 129 // to contain pointers to each of the embedder's MojoCore functions. |
| 129 inline MojoSystemThunks MojoMakeSystemThunks() { | 130 inline MojoSystemThunks MojoMakeSystemThunks() { |
| 130 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), | 131 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), |
| 131 MojoGetTimeTicksNow, | 132 MojoGetTimeTicksNow, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 144 MojoEndReadData, | 145 MojoEndReadData, |
| 145 MojoCreateSharedBuffer, | 146 MojoCreateSharedBuffer, |
| 146 MojoDuplicateBufferHandle, | 147 MojoDuplicateBufferHandle, |
| 147 MojoMapBuffer, | 148 MojoMapBuffer, |
| 148 MojoUnmapBuffer, | 149 MojoUnmapBuffer, |
| 149 MojoCreateWaitSet, | 150 MojoCreateWaitSet, |
| 150 MojoAddHandle, | 151 MojoAddHandle, |
| 151 MojoRemoveHandle, | 152 MojoRemoveHandle, |
| 152 MojoGetReadyHandles, | 153 MojoGetReadyHandles, |
| 153 MojoWatch, | 154 MojoWatch, |
| 154 MojoCancelWatch}; | 155 MojoCancelWatch, |
| 156 MojoFuseMessagePipes}; |
| 155 return system_thunks; | 157 return system_thunks; |
| 156 } | 158 } |
| 157 #endif | 159 #endif |
| 158 | 160 |
| 159 | 161 |
| 160 // 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 |
| 161 // a DSO linked with mojo_system. For example: | 163 // a DSO linked with mojo_system. For example: |
| 162 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = | 164 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
| 163 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( | 165 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
| 164 // "MojoSetSystemThunks")); | 166 // "MojoSetSystemThunks")); |
| 165 // The expected size of |system_thunks} is returned. | 167 // The expected size of |system_thunks} is returned. |
| 166 // The contents of |system_thunks| are copied. | 168 // The contents of |system_thunks| are copied. |
| 167 typedef size_t (*MojoSetSystemThunksFn)( | 169 typedef size_t (*MojoSetSystemThunksFn)( |
| 168 const struct MojoSystemThunks* system_thunks); | 170 const struct MojoSystemThunks* system_thunks); |
| 169 | 171 |
| 170 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 172 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
| OLD | NEW |