OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "mojo/public/c/system/thunks.h" | 5 #include "mojo/public/c/system/thunks.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 MojoResult MojoGetReadyHandles(MojoHandle wait_set, | 178 MojoResult MojoGetReadyHandles(MojoHandle wait_set, |
179 uint32_t* count, | 179 uint32_t* count, |
180 MojoHandle* handles, | 180 MojoHandle* handles, |
181 MojoResult* results, | 181 MojoResult* results, |
182 struct MojoHandleSignalsState* signals_states) { | 182 struct MojoHandleSignalsState* signals_states) { |
183 assert(g_thunks.GetReadyHandles); | 183 assert(g_thunks.GetReadyHandles); |
184 return g_thunks.GetReadyHandles(wait_set, count, handles, results, | 184 return g_thunks.GetReadyHandles(wait_set, count, handles, results, |
185 signals_states); | 185 signals_states); |
186 } | 186 } |
187 | 187 |
188 MojoResult MojoWatch(MojoHandle handle, | 188 MojoResult MojoRegisterWatcher(MojoHandle handle, |
189 MojoHandleSignals signals, | 189 MojoHandleSignals signals, |
190 MojoWatchCallback callback, | 190 MojoWatchCallback callback, |
191 uintptr_t context) { | 191 uintptr_t context) { |
192 assert(g_thunks.Watch); | 192 assert(g_thunks.RegisterWatcher); |
193 return g_thunks.Watch(handle, signals, callback, context); | 193 return g_thunks.RegisterWatcher(handle, signals, callback, context); |
194 } | 194 } |
195 | 195 |
196 MojoResult MojoCancelWatch(MojoHandle handle, uintptr_t context) { | 196 MojoResult MojoArmWatcher(MojoHandle handle, uintptr_t context) { |
197 assert(g_thunks.CancelWatch); | 197 assert(g_thunks.ArmWatcher); |
198 return g_thunks.CancelWatch(handle, context); | 198 return g_thunks.ArmWatcher(handle, context); |
| 199 } |
| 200 |
| 201 MojoResult MojoUnregisterWatcher(MojoHandle handle, uintptr_t context) { |
| 202 assert(g_thunks.UnregisterWatcher); |
| 203 return g_thunks.UnregisterWatcher(handle, context); |
199 } | 204 } |
200 | 205 |
201 MojoResult MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1) { | 206 MojoResult MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1) { |
202 assert(g_thunks.FuseMessagePipes); | 207 assert(g_thunks.FuseMessagePipes); |
203 return g_thunks.FuseMessagePipes(handle0, handle1); | 208 return g_thunks.FuseMessagePipes(handle0, handle1); |
204 } | 209 } |
205 | 210 |
206 MojoResult MojoWriteMessageNew(MojoHandle message_pipe_handle, | 211 MojoResult MojoWriteMessageNew(MojoHandle message_pipe_handle, |
207 MojoMessageHandle message, | 212 MojoMessageHandle message, |
208 MojoWriteMessageFlags flags) { | 213 MojoWriteMessageFlags flags) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 return g_thunks.GetProperty(type, value); | 292 return g_thunks.GetProperty(type, value); |
288 } | 293 } |
289 | 294 |
290 } // extern "C" | 295 } // extern "C" |
291 | 296 |
292 size_t MojoEmbedderSetSystemThunks(const MojoSystemThunks* system_thunks) { | 297 size_t MojoEmbedderSetSystemThunks(const MojoSystemThunks* system_thunks) { |
293 if (system_thunks->size >= sizeof(g_thunks)) | 298 if (system_thunks->size >= sizeof(g_thunks)) |
294 g_thunks = *system_thunks; | 299 g_thunks = *system_thunks; |
295 return sizeof(g_thunks); | 300 return sizeof(g_thunks); |
296 } | 301 } |
OLD | NEW |