| 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 #include "mojo/public/platform/native/thunk_export.h" | 9 #include "mojo/public/platform/native/thunk_export.h" |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 MojoResult MojoWaitMany(const MojoHandle* handles, | 32 MojoResult MojoWaitMany(const MojoHandle* handles, |
| 33 const MojoHandleSignals* signals, | 33 const MojoHandleSignals* signals, |
| 34 uint32_t num_handles, | 34 uint32_t num_handles, |
| 35 MojoDeadline deadline) { | 35 MojoDeadline deadline) { |
| 36 assert(g_thunks.WaitMany); | 36 assert(g_thunks.WaitMany); |
| 37 return g_thunks.WaitMany(handles, signals, num_handles, deadline); | 37 return g_thunks.WaitMany(handles, signals, num_handles, deadline); |
| 38 } | 38 } |
| 39 | 39 |
| 40 MojoResult MojoNewWait(MojoHandle handle, |
| 41 MojoHandleSignals signals, |
| 42 MojoDeadline deadline, |
| 43 struct MojoHandleSignalsState* signals_state) { |
| 44 assert(g_thunks.NewWait); |
| 45 return g_thunks.NewWait(handle, signals, deadline, signals_state); |
| 46 } |
| 47 |
| 48 MojoResult MojoNewWaitMany(const MojoHandle* handles, |
| 49 const MojoHandleSignals* signals, |
| 50 uint32_t num_handles, |
| 51 MojoDeadline deadline, |
| 52 uint32_t* result_index, |
| 53 struct MojoHandleSignalsState* signals_states) { |
| 54 assert(g_thunks.NewWaitMany); |
| 55 return g_thunks.NewWaitMany(handles, signals, num_handles, deadline, |
| 56 result_index, signals_states); |
| 57 } |
| 58 |
| 40 MojoResult MojoCreateMessagePipe(const MojoCreateMessagePipeOptions* options, | 59 MojoResult MojoCreateMessagePipe(const MojoCreateMessagePipeOptions* options, |
| 41 MojoHandle* message_pipe_handle0, | 60 MojoHandle* message_pipe_handle0, |
| 42 MojoHandle* message_pipe_handle1) { | 61 MojoHandle* message_pipe_handle1) { |
| 43 assert(g_thunks.CreateMessagePipe); | 62 assert(g_thunks.CreateMessagePipe); |
| 44 return g_thunks.CreateMessagePipe(options, message_pipe_handle0, | 63 return g_thunks.CreateMessagePipe(options, message_pipe_handle0, |
| 45 message_pipe_handle1); | 64 message_pipe_handle1); |
| 46 } | 65 } |
| 47 | 66 |
| 48 MojoResult MojoWriteMessage(MojoHandle message_pipe_handle, | 67 MojoResult MojoWriteMessage(MojoHandle message_pipe_handle, |
| 49 const void* bytes, | 68 const void* bytes, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 174 } |
| 156 | 175 |
| 157 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( | 176 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( |
| 158 const MojoSystemThunks* system_thunks) { | 177 const MojoSystemThunks* system_thunks) { |
| 159 if (system_thunks->size >= sizeof(g_thunks)) | 178 if (system_thunks->size >= sizeof(g_thunks)) |
| 160 g_thunks = *system_thunks; | 179 g_thunks = *system_thunks; |
| 161 return sizeof(g_thunks); | 180 return sizeof(g_thunks); |
| 162 } | 181 } |
| 163 | 182 |
| 164 } // extern "C" | 183 } // extern "C" |
| OLD | NEW |