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

Side by Side Diff: mojo/public/c/system/handle.h

Issue 2001673003: EDK: Add Core::DuplicateHandleWithReducedRights(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 Mojo system handle-related declarations/definitions. 5 // This file contains Mojo system handle-related declarations/definitions.
6 // 6 //
7 // Note: This header should be compilable as C. 7 // Note: This header should be compilable as C.
8 8
9 #ifndef MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ 9 #ifndef MOJO_PUBLIC_C_SYSTEM_HANDLE_H_
10 #define MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ 10 #define MOJO_PUBLIC_C_SYSTEM_HANDLE_H_
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // 135 //
136 // Note that it is not an error to "remove" rights that the handle does not 136 // Note that it is not an error to "remove" rights that the handle does not
137 // (currently) possess. 137 // (currently) possess.
138 // 138 //
139 // Returns: 139 // Returns:
140 // |MOJO_RESULT_OK| on success. 140 // |MOJO_RESULT_OK| on success.
141 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle. 141 // |MOJO_RESULT_INVALID_ARGUMENT| if |handle| is not a valid handle.
142 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction 142 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction
143 // (that, e.g., may result in it being invalidated, such as being sent in 143 // (that, e.g., may result in it being invalidated, such as being sent in
144 // a message). 144 // a message).
145 //
146 // TODO(vtl): Discuss this API some more. It may be more desirable to replace
147 // the handle with a new one (with reduced rights).
145 MojoResult MojoReduceRights(MojoHandle handle, 148 MojoResult MojoReduceRights(MojoHandle handle,
146 MojoHandleRights rights_to_remove); 149 MojoHandleRights rights_to_remove);
147 150
148 // |MojoDuplicateHandleWithReducedRights()|: Duplicates |handle| to a new handle 151 // |MojoDuplicateHandleWithReducedRights()|: Duplicates |handle| to a new handle
149 // with reduced rights. This requires |handle| to have the 152 // with reduced rights. This requires |handle| to have the
150 // |MOJO_HANDLE_RIGHT_DUPLICATE| (note that some handle types may never have 153 // |MOJO_HANDLE_RIGHT_DUPLICATE| (note that some handle types may never have
151 // this right). 154 // this right).
152 // 155 //
153 // The rights for the new handle are determined as in |MojoReduceRights()|. That 156 // The rights for the new handle are determined as in |MojoReduceRights()|. That
154 // is, on success: 157 // is, on success:
(...skipping 29 matching lines...) Expand all
184 // been reached. 187 // been reached.
185 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction 188 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction
186 // (that, e.g., may result in it being invalidated, such as being sent in 189 // (that, e.g., may result in it being invalidated, such as being sent in
187 // a message). 190 // a message).
188 MojoResult MojoDuplicateHandle(MojoHandle handle, 191 MojoResult MojoDuplicateHandle(MojoHandle handle,
189 MojoHandle* new_handle); // Out. 192 MojoHandle* new_handle); // Out.
190 193
191 MOJO_END_EXTERN_C 194 MOJO_END_EXTERN_C
192 195
193 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ 196 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698