| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_impl_private_thunks.h" | 5 #include "mojo/public/platform/native/system_impl_private_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 30 matching lines...) Expand all Loading... |
| 41 return g_system_impl_thunks.Close(system, handle); | 41 return g_system_impl_thunks.Close(system, handle); |
| 42 } | 42 } |
| 43 | 43 |
| 44 MojoResult MojoSystemImplGetRights(MojoSystemImpl system, | 44 MojoResult MojoSystemImplGetRights(MojoSystemImpl system, |
| 45 MojoHandle handle, | 45 MojoHandle handle, |
| 46 MojoHandleRights* rights) { | 46 MojoHandleRights* rights) { |
| 47 assert(g_system_impl_thunks.GetRights); | 47 assert(g_system_impl_thunks.GetRights); |
| 48 return g_system_impl_thunks.GetRights(system, handle, rights); | 48 return g_system_impl_thunks.GetRights(system, handle, rights); |
| 49 } | 49 } |
| 50 | 50 |
| 51 MojoResult MojoSystemImplDuplicateHandleWithReducedRights( |
| 52 MojoSystemImpl system, |
| 53 MojoHandle handle, |
| 54 MojoHandleRights rights_to_remove, |
| 55 MojoHandle* new_handle) { |
| 56 assert(g_system_impl_thunks.DuplicateHandleWithReducedRights); |
| 57 return g_system_impl_thunks.DuplicateHandleWithReducedRights( |
| 58 system, handle, rights_to_remove, new_handle); |
| 59 } |
| 60 |
| 61 MojoResult MojoSystemImplDuplicateHandle(MojoSystemImpl system, |
| 62 MojoHandle handle, |
| 63 MojoHandle* new_handle) { |
| 64 assert(g_system_impl_thunks.DuplicateHandle); |
| 65 return g_system_impl_thunks.DuplicateHandle(system, handle, new_handle); |
| 66 } |
| 67 |
| 51 MojoResult MojoSystemImplWait(MojoSystemImpl system, | 68 MojoResult MojoSystemImplWait(MojoSystemImpl system, |
| 52 MojoHandle handle, | 69 MojoHandle handle, |
| 53 MojoHandleSignals signals, | 70 MojoHandleSignals signals, |
| 54 MojoDeadline deadline, | 71 MojoDeadline deadline, |
| 55 struct MojoHandleSignalsState* signals_state) { | 72 struct MojoHandleSignalsState* signals_state) { |
| 56 assert(g_system_impl_thunks.Wait); | 73 assert(g_system_impl_thunks.Wait); |
| 57 return g_system_impl_thunks.Wait(system, handle, signals, deadline, | 74 return g_system_impl_thunks.Wait(system, handle, signals, deadline, |
| 58 signals_state); | 75 signals_state); |
| 59 } | 76 } |
| 60 | 77 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 g_system_impl_control_thunks = *system_thunks; | 280 g_system_impl_control_thunks = *system_thunks; |
| 264 return sizeof(g_system_impl_control_thunks); | 281 return sizeof(g_system_impl_control_thunks); |
| 265 } | 282 } |
| 266 | 283 |
| 267 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( | 284 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( |
| 268 const struct MojoSystemImplThunksPrivate* system_thunks) { | 285 const struct MojoSystemImplThunksPrivate* system_thunks) { |
| 269 if (system_thunks->size >= sizeof(g_system_impl_thunks)) | 286 if (system_thunks->size >= sizeof(g_system_impl_thunks)) |
| 270 g_system_impl_thunks = *system_thunks; | 287 g_system_impl_thunks = *system_thunks; |
| 271 return sizeof(g_system_impl_thunks); | 288 return sizeof(g_system_impl_thunks); |
| 272 } | 289 } |
| OLD | NEW |