| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file contains the definitions of the system functions, which are | 5 // This file contains the definitions of the system functions, which are |
| 6 // declared in various header files in mojo/public/c/system. | 6 // declared in various header files in mojo/public/c/system. |
| 7 | 7 |
| 8 #include "mojo/edk/embedder/embedder_internal.h" | 8 #include "mojo/edk/embedder/embedder_internal.h" |
| 9 #include "mojo/edk/system/core.h" | 9 #include "mojo/edk/system/core.h" |
| 10 #include "mojo/public/c/system/buffer.h" | 10 #include "mojo/public/c/system/buffer.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 MojoResult MojoClose(MojoHandle handle) { | 26 MojoResult MojoClose(MojoHandle handle) { |
| 27 return g_core->Close(handle); | 27 return g_core->Close(handle); |
| 28 } | 28 } |
| 29 | 29 |
| 30 MojoResult MojoGetRights(MojoHandle handle, MojoHandleRights* rights) { | 30 MojoResult MojoGetRights(MojoHandle handle, MojoHandleRights* rights) { |
| 31 return g_core->GetRights(handle, MakeUserPointer(rights)); | 31 return g_core->GetRights(handle, MakeUserPointer(rights)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 MojoResult MojoReplaceHandleWithReducedRights(MojoHandle handle, |
| 35 MojoHandleRights rights_to_remove, |
| 36 MojoHandle* replacement_handle) { |
| 37 return g_core->ReplaceHandleWithReducedRights( |
| 38 handle, rights_to_remove, MakeUserPointer(replacement_handle)); |
| 39 } |
| 40 |
| 34 MojoResult MojoDuplicateHandleWithReducedRights( | 41 MojoResult MojoDuplicateHandleWithReducedRights( |
| 35 MojoHandle handle, | 42 MojoHandle handle, |
| 36 MojoHandleRights rights_to_remove, | 43 MojoHandleRights rights_to_remove, |
| 37 MojoHandle* new_handle) { | 44 MojoHandle* new_handle) { |
| 38 return g_core->DuplicateHandleWithReducedRights(handle, rights_to_remove, | 45 return g_core->DuplicateHandleWithReducedRights(handle, rights_to_remove, |
| 39 MakeUserPointer(new_handle)); | 46 MakeUserPointer(new_handle)); |
| 40 } | 47 } |
| 41 | 48 |
| 42 MojoResult MojoDuplicateHandle(MojoHandle handle, MojoHandle* new_handle) { | 49 MojoResult MojoDuplicateHandle(MojoHandle handle, MojoHandle* new_handle) { |
| 43 return g_core->DuplicateHandleWithReducedRights( | 50 return g_core->DuplicateHandleWithReducedRights( |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 MojoMapBufferFlags flags) { | 212 MojoMapBufferFlags flags) { |
| 206 return g_core->MapBuffer(buffer_handle, offset, num_bytes, | 213 return g_core->MapBuffer(buffer_handle, offset, num_bytes, |
| 207 MakeUserPointer(buffer), flags); | 214 MakeUserPointer(buffer), flags); |
| 208 } | 215 } |
| 209 | 216 |
| 210 MojoResult MojoUnmapBuffer(void* buffer) { | 217 MojoResult MojoUnmapBuffer(void* buffer) { |
| 211 return g_core->UnmapBuffer(MakeUserPointer(buffer)); | 218 return g_core->UnmapBuffer(MakeUserPointer(buffer)); |
| 212 } | 219 } |
| 213 | 220 |
| 214 } // extern "C" | 221 } // extern "C" |
| OLD | NEW |