| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 uintptr_t context) { | 193 uintptr_t context) { |
| 194 assert(g_thunks.Watch); | 194 assert(g_thunks.Watch); |
| 195 return g_thunks.Watch(handle, signals, callback, context); | 195 return g_thunks.Watch(handle, signals, callback, context); |
| 196 } | 196 } |
| 197 | 197 |
| 198 MojoResult MojoCancelWatch(MojoHandle handle, uintptr_t context) { | 198 MojoResult MojoCancelWatch(MojoHandle handle, uintptr_t context) { |
| 199 assert(g_thunks.CancelWatch); | 199 assert(g_thunks.CancelWatch); |
| 200 return g_thunks.CancelWatch(handle, context); | 200 return g_thunks.CancelWatch(handle, context); |
| 201 } | 201 } |
| 202 | 202 |
| 203 MojoResult MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1) { |
| 204 assert(g_thunks.FuseMessagePipes); |
| 205 return g_thunks.FuseMessagePipes(handle0, handle1); |
| 206 } |
| 207 |
| 203 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( | 208 extern "C" THUNK_EXPORT size_t MojoSetSystemThunks( |
| 204 const MojoSystemThunks* system_thunks) { | 209 const MojoSystemThunks* system_thunks) { |
| 205 if (system_thunks->size >= sizeof(g_thunks)) | 210 if (system_thunks->size >= sizeof(g_thunks)) |
| 206 g_thunks = *system_thunks; | 211 g_thunks = *system_thunks; |
| 207 return sizeof(g_thunks); | 212 return sizeof(g_thunks); |
| 208 } | 213 } |
| 209 | 214 |
| 210 } // extern "C" | 215 } // extern "C" |
| OLD | NEW |