| 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/platform/native/system_thunks.h" | 5 #include "mojo/public/platform/native/system_thunks.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 | 8 |
| 9 extern "C" { | 9 extern "C" { |
| 10 | 10 |
| 11 static MojoSystemThunks g_thunks = {0}; | 11 static MojoSystemThunks g_thunks = {0}; |
| 12 | 12 |
| 13 MojoTimeTicks MojoGetTimeTicksNow() { | 13 MojoTimeTicks MojoGetTimeTicksNow() { |
| 14 assert(g_thunks.GetTimeTicksNow); | 14 assert(g_thunks.GetTimeTicksNow); |
| 15 return g_thunks.GetTimeTicksNow(); | 15 return g_thunks.GetTimeTicksNow(); |
| 16 } | 16 } |
| 17 | 17 |
| 18 MojoResult MojoClose(MojoHandle handle) { | 18 MojoResult MojoClose(MojoHandle handle) { |
| 19 assert(g_thunks.Close); | 19 assert(g_thunks.Close); |
| 20 return g_thunks.Close(handle); | 20 return g_thunks.Close(handle); |
| 21 } | 21 } |
| 22 | 22 |
| 23 MojoResult MojoWait(MojoHandle handle, | 23 MojoResult MojoWait(MojoHandle handle, |
| 24 MojoWaitFlags flags, | 24 MojoHandleSignals signals, |
| 25 MojoDeadline deadline) { | 25 MojoDeadline deadline) { |
| 26 assert(g_thunks.Wait); | 26 assert(g_thunks.Wait); |
| 27 return g_thunks.Wait(handle, flags, deadline); | 27 return g_thunks.Wait(handle, signals, deadline); |
| 28 } | 28 } |
| 29 | 29 |
| 30 MojoResult MojoWaitMany(const MojoHandle* handles, | 30 MojoResult MojoWaitMany(const MojoHandle* handles, |
| 31 const MojoWaitFlags* flags, | 31 const MojoHandleSignals* signals, |
| 32 uint32_t num_handles, | 32 uint32_t num_handles, |
| 33 MojoDeadline deadline) { | 33 MojoDeadline deadline) { |
| 34 assert(g_thunks.WaitMany); | 34 assert(g_thunks.WaitMany); |
| 35 return g_thunks.WaitMany(handles, flags, num_handles, deadline); | 35 return g_thunks.WaitMany(handles, signals, num_handles, deadline); |
| 36 } | 36 } |
| 37 | 37 |
| 38 MojoResult MojoCreateMessagePipe(const MojoCreateMessagePipeOptions* options, | 38 MojoResult MojoCreateMessagePipe(const MojoCreateMessagePipeOptions* options, |
| 39 MojoHandle* message_pipe_handle0, | 39 MojoHandle* message_pipe_handle0, |
| 40 MojoHandle* message_pipe_handle1) { | 40 MojoHandle* message_pipe_handle1) { |
| 41 assert(g_thunks.CreateMessagePipe); | 41 assert(g_thunks.CreateMessagePipe); |
| 42 return g_thunks.CreateMessagePipe(options, message_pipe_handle0, | 42 return g_thunks.CreateMessagePipe(options, message_pipe_handle0, |
| 43 message_pipe_handle1); | 43 message_pipe_handle1); |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 #endif | 161 #endif |
| 162 | 162 |
| 163 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( | 163 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( |
| 164 const MojoSystemThunks* system_thunks) { | 164 const MojoSystemThunks* system_thunks) { |
| 165 if (system_thunks->size >= sizeof(g_thunks)) | 165 if (system_thunks->size >= sizeof(g_thunks)) |
| 166 g_thunks = *system_thunks; | 166 g_thunks = *system_thunks; |
| 167 return sizeof(g_thunks); | 167 return sizeof(g_thunks); |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // extern "C" | 170 } // extern "C" |
| OLD | NEW |