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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "mojo/edk/embedder/embedder_internal.h" | 6 #include "mojo/edk/embedder/embedder_internal.h" |
7 #include "mojo/edk/system/core.h" | 7 #include "mojo/edk/system/core.h" |
8 #include "mojo/edk/system/dispatcher.h" | 8 #include "mojo/edk/system/dispatcher.h" |
9 #include "mojo/edk/system/handle.h" | 9 #include "mojo/edk/system/handle.h" |
10 #include "mojo/edk/util/ref_ptr.h" | 10 #include "mojo/edk/util/ref_ptr.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 MojoResult MojoSystemImplGetRights(MojoSystemImpl system, | 95 MojoResult MojoSystemImplGetRights(MojoSystemImpl system, |
96 MojoHandle handle, | 96 MojoHandle handle, |
97 MojoHandleRights* rights) { | 97 MojoHandleRights* rights) { |
98 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 98 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
99 DCHECK(core); | 99 DCHECK(core); |
100 return core->GetRights(handle, MakeUserPointer(rights)); | 100 return core->GetRights(handle, MakeUserPointer(rights)); |
101 } | 101 } |
102 | 102 |
| 103 MojoResult MojoSystemImplDuplicateHandleWithReducedRights( |
| 104 MojoSystemImpl system, |
| 105 MojoHandle handle, |
| 106 MojoHandleRights rights_to_remove, |
| 107 MojoHandle* new_handle) { |
| 108 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 109 DCHECK(core); |
| 110 return core->DuplicateHandleWithReducedRights(handle, rights_to_remove, |
| 111 MakeUserPointer(new_handle)); |
| 112 } |
| 113 |
| 114 MojoResult MojoSystemImplDuplicateHandle(MojoSystemImpl system, |
| 115 MojoHandle handle, |
| 116 MojoHandle* new_handle) { |
| 117 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
| 118 DCHECK(core); |
| 119 return core->DuplicateHandleWithReducedRights(handle, MOJO_HANDLE_RIGHT_NONE, |
| 120 MakeUserPointer(new_handle)); |
| 121 } |
| 122 |
103 MojoResult MojoSystemImplWait(MojoSystemImpl system, | 123 MojoResult MojoSystemImplWait(MojoSystemImpl system, |
104 MojoHandle handle, | 124 MojoHandle handle, |
105 MojoHandleSignals signals, | 125 MojoHandleSignals signals, |
106 MojoDeadline deadline, | 126 MojoDeadline deadline, |
107 MojoHandleSignalsState* signals_state) { | 127 MojoHandleSignalsState* signals_state) { |
108 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 128 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
109 DCHECK(core); | 129 DCHECK(core); |
110 return core->Wait(handle, signals, deadline, MakeUserPointer(signals_state)); | 130 return core->Wait(handle, signals, deadline, MakeUserPointer(signals_state)); |
111 } | 131 } |
112 | 132 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 MakeUserPointer(buffer), flags); | 343 MakeUserPointer(buffer), flags); |
324 } | 344 } |
325 | 345 |
326 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { | 346 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { |
327 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); | 347 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); |
328 DCHECK(core); | 348 DCHECK(core); |
329 return core->UnmapBuffer(MakeUserPointer(buffer)); | 349 return core->UnmapBuffer(MakeUserPointer(buffer)); |
330 } | 350 } |
331 | 351 |
332 } // extern "C" | 352 } // extern "C" |
OLD | NEW |