| 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 MojoSystemImplReplaceHandleWithReducedRights( |
| 52 MojoSystemImpl system, |
| 53 MojoHandle handle, |
| 54 MojoHandleRights rights_to_remove, |
| 55 MojoHandle* replacement_handle) { |
| 56 assert(g_system_impl_thunks.ReplaceHandleWithReducedRights); |
| 57 return g_system_impl_thunks.ReplaceHandleWithReducedRights( |
| 58 system, handle, rights_to_remove, replacement_handle); |
| 59 } |
| 60 |
| 51 MojoResult MojoSystemImplDuplicateHandleWithReducedRights( | 61 MojoResult MojoSystemImplDuplicateHandleWithReducedRights( |
| 52 MojoSystemImpl system, | 62 MojoSystemImpl system, |
| 53 MojoHandle handle, | 63 MojoHandle handle, |
| 54 MojoHandleRights rights_to_remove, | 64 MojoHandleRights rights_to_remove, |
| 55 MojoHandle* new_handle) { | 65 MojoHandle* new_handle) { |
| 56 assert(g_system_impl_thunks.DuplicateHandleWithReducedRights); | 66 assert(g_system_impl_thunks.DuplicateHandleWithReducedRights); |
| 57 return g_system_impl_thunks.DuplicateHandleWithReducedRights( | 67 return g_system_impl_thunks.DuplicateHandleWithReducedRights( |
| 58 system, handle, rights_to_remove, new_handle); | 68 system, handle, rights_to_remove, new_handle); |
| 59 } | 69 } |
| 60 | 70 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 g_system_impl_control_thunks = *system_thunks; | 290 g_system_impl_control_thunks = *system_thunks; |
| 281 return sizeof(g_system_impl_control_thunks); | 291 return sizeof(g_system_impl_control_thunks); |
| 282 } | 292 } |
| 283 | 293 |
| 284 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( | 294 THUNK_EXPORT size_t MojoSetSystemImplThunksPrivate( |
| 285 const struct MojoSystemImplThunksPrivate* system_thunks) { | 295 const struct MojoSystemImplThunksPrivate* system_thunks) { |
| 286 if (system_thunks->size >= sizeof(g_system_impl_thunks)) | 296 if (system_thunks->size >= sizeof(g_system_impl_thunks)) |
| 287 g_system_impl_thunks = *system_thunks; | 297 g_system_impl_thunks = *system_thunks; |
| 288 return sizeof(g_system_impl_thunks); | 298 return sizeof(g_system_impl_thunks); |
| 289 } | 299 } |
| OLD | NEW |