Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: mojo/edk/embedder/system_impl_private_entrypoints.cc

Issue 2056513002: Plumb MojoReplaceHandleWithReducedRights() out. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_replace_reduce_1
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 MojoSystemImplReplaceHandleWithReducedRights(
104 MojoSystemImpl system,
105 MojoHandle handle,
106 MojoHandleRights rights_to_remove,
107 MojoHandle* replacement_handle) {
108 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
109 DCHECK(core);
110 return core->ReplaceHandleWithReducedRights(
111 handle, rights_to_remove, MakeUserPointer(replacement_handle));
112 }
113
103 MojoResult MojoSystemImplDuplicateHandleWithReducedRights( 114 MojoResult MojoSystemImplDuplicateHandleWithReducedRights(
104 MojoSystemImpl system, 115 MojoSystemImpl system,
105 MojoHandle handle, 116 MojoHandle handle,
106 MojoHandleRights rights_to_remove, 117 MojoHandleRights rights_to_remove,
107 MojoHandle* new_handle) { 118 MojoHandle* new_handle) {
108 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); 119 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
109 DCHECK(core); 120 DCHECK(core);
110 return core->DuplicateHandleWithReducedRights(handle, rights_to_remove, 121 return core->DuplicateHandleWithReducedRights(handle, rights_to_remove,
111 MakeUserPointer(new_handle)); 122 MakeUserPointer(new_handle));
112 } 123 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 MakeUserPointer(buffer), flags); 354 MakeUserPointer(buffer), flags);
344 } 355 }
345 356
346 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) { 357 MojoResult MojoSystemImplUnmapBuffer(MojoSystemImpl system, void* buffer) {
347 mojo::system::Core* core = static_cast<mojo::system::Core*>(system); 358 mojo::system::Core* core = static_cast<mojo::system::Core*>(system);
348 DCHECK(core); 359 DCHECK(core);
349 return core->UnmapBuffer(MakeUserPointer(buffer)); 360 return core->UnmapBuffer(MakeUserPointer(buffer));
350 } 361 }
351 362
352 } // extern "C" 363 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698