| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 MojoMapBufferFlags flags) { | 219 MojoMapBufferFlags flags) { |
| 220 assert(g_thunks.MapBuffer); | 220 assert(g_thunks.MapBuffer); |
| 221 return g_thunks.MapBuffer(buffer_handle, offset, num_bytes, buffer, flags); | 221 return g_thunks.MapBuffer(buffer_handle, offset, num_bytes, buffer, flags); |
| 222 } | 222 } |
| 223 | 223 |
| 224 MojoResult MojoUnmapBuffer(void* buffer) { | 224 MojoResult MojoUnmapBuffer(void* buffer) { |
| 225 assert(g_thunks.UnmapBuffer); | 225 assert(g_thunks.UnmapBuffer); |
| 226 return g_thunks.UnmapBuffer(buffer); | 226 return g_thunks.UnmapBuffer(buffer); |
| 227 } | 227 } |
| 228 | 228 |
| 229 MojoResult MojoCreateWaitSet(const struct MojoCreateWaitSetOptions* options, |
| 230 MojoHandle* handle) { |
| 231 assert(g_thunks.CreateWaitSet); |
| 232 return g_thunks.CreateWaitSet(options, handle); |
| 233 } |
| 234 |
| 235 MojoResult MojoWaitSetAdd(MojoHandle wait_set_handle, |
| 236 MojoHandle handle, |
| 237 MojoHandleSignals signals, |
| 238 uint64_t cookie, |
| 239 const struct MojoWaitSetAddOptions* options) { |
| 240 assert(g_thunks.WaitSetAdd); |
| 241 return g_thunks.WaitSetAdd(wait_set_handle, handle, signals, cookie, options); |
| 242 } |
| 243 |
| 244 MojoResult MojoWaitSetRemove(MojoHandle wait_set_handle, uint64_t cookie) { |
| 245 assert(g_thunks.WaitSetRemove); |
| 246 return g_thunks.WaitSetRemove(wait_set_handle, cookie); |
| 247 } |
| 248 |
| 249 MojoResult MojoWaitSetWait(MojoHandle wait_set_handle, |
| 250 MojoDeadline deadline, |
| 251 uint32_t* num_results, |
| 252 struct MojoWaitSetResult* results, |
| 253 uint32_t* max_results) { |
| 254 assert(g_thunks.WaitSetWait); |
| 255 return g_thunks.WaitSetWait(wait_set_handle, deadline, num_results, results, |
| 256 max_results); |
| 257 } |
| 258 |
| 229 THUNK_EXPORT size_t | 259 THUNK_EXPORT size_t |
| 230 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) { | 260 MojoSetSystemThunks(const struct MojoSystemThunks* system_thunks) { |
| 231 if (system_thunks->size >= sizeof(g_thunks)) | 261 if (system_thunks->size >= sizeof(g_thunks)) |
| 232 g_thunks = *system_thunks; | 262 g_thunks = *system_thunks; |
| 233 return sizeof(g_thunks); | 263 return sizeof(g_thunks); |
| 234 } | 264 } |
| OLD | NEW |