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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 MojoResult (*FuseMessagePipes)(MojoHandle handle0, MojoHandle handle1); |
| 123 MojoResult (*WriteMessageNew)(MojoHandle message_pipe_handle, |
| 124 MojoMessageHandle message, |
| 125 MojoWriteMessageFlags flags); |
| 126 MojoResult (*ReadMessageNew)(MojoHandle message_pipe_handle, |
| 127 MojoMessageHandle* message, |
| 128 uint32_t* num_bytes, |
| 129 MojoHandle* handles, |
| 130 uint32_t* num_handles, |
| 131 MojoReadMessageFlags flags); |
| 132 MojoResult (*AllocMessage)(uint32_t num_bytes, |
| 133 const MojoHandle* handles, |
| 134 uint32_t num_handles, |
| 135 MojoAllocMessageFlags flags, |
| 136 MojoMessageHandle* message); |
| 137 MojoResult (*FreeMessage)(MojoMessageHandle message); |
| 138 MojoResult (*GetMessageBuffer)(MojoMessageHandle message, void** buffer); |
123 }; | 139 }; |
124 #pragma pack(pop) | 140 #pragma pack(pop) |
125 | 141 |
126 | 142 |
127 #ifdef __cplusplus | 143 #ifdef __cplusplus |
128 // Intended to be called from the embedder. Returns a |MojoCore| initialized | 144 // Intended to be called from the embedder. Returns a |MojoCore| initialized |
129 // to contain pointers to each of the embedder's MojoCore functions. | 145 // to contain pointers to each of the embedder's MojoCore functions. |
130 inline MojoSystemThunks MojoMakeSystemThunks() { | 146 inline MojoSystemThunks MojoMakeSystemThunks() { |
131 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), | 147 MojoSystemThunks system_thunks = {sizeof(MojoSystemThunks), |
132 MojoGetTimeTicksNow, | 148 MojoGetTimeTicksNow, |
(...skipping 13 matching lines...) Expand all Loading... |
146 MojoCreateSharedBuffer, | 162 MojoCreateSharedBuffer, |
147 MojoDuplicateBufferHandle, | 163 MojoDuplicateBufferHandle, |
148 MojoMapBuffer, | 164 MojoMapBuffer, |
149 MojoUnmapBuffer, | 165 MojoUnmapBuffer, |
150 MojoCreateWaitSet, | 166 MojoCreateWaitSet, |
151 MojoAddHandle, | 167 MojoAddHandle, |
152 MojoRemoveHandle, | 168 MojoRemoveHandle, |
153 MojoGetReadyHandles, | 169 MojoGetReadyHandles, |
154 MojoWatch, | 170 MojoWatch, |
155 MojoCancelWatch, | 171 MojoCancelWatch, |
156 MojoFuseMessagePipes}; | 172 MojoFuseMessagePipes, |
| 173 MojoWriteMessageNew, |
| 174 MojoReadMessageNew, |
| 175 MojoAllocMessage, |
| 176 MojoFreeMessage, |
| 177 MojoGetMessageBuffer}; |
157 return system_thunks; | 178 return system_thunks; |
158 } | 179 } |
159 #endif | 180 #endif |
160 | 181 |
161 | 182 |
162 // Use this type for the function found by dynamically discovering it in | 183 // Use this type for the function found by dynamically discovering it in |
163 // a DSO linked with mojo_system. For example: | 184 // a DSO linked with mojo_system. For example: |
164 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = | 185 // MojoSetSystemThunksFn mojo_set_system_thunks_fn = |
165 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( | 186 // reinterpret_cast<MojoSetSystemThunksFn>(app_library.GetFunctionPointer( |
166 // "MojoSetSystemThunks")); | 187 // "MojoSetSystemThunks")); |
167 // The expected size of |system_thunks} is returned. | 188 // The expected size of |system_thunks} is returned. |
168 // The contents of |system_thunks| are copied. | 189 // The contents of |system_thunks| are copied. |
169 typedef size_t (*MojoSetSystemThunksFn)( | 190 typedef size_t (*MojoSetSystemThunksFn)( |
170 const struct MojoSystemThunks* system_thunks); | 191 const struct MojoSystemThunks* system_thunks); |
171 | 192 |
172 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ | 193 #endif // MOJO_PUBLIC_PLATFORM_NATIVE_SYSTEM_THUNKS_H_ |
OLD | NEW |