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

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

Issue 1963053003: Add rights for get/set options. Update message pipe and data pipe APIs. (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/public/c/system/data_pipe.h ('k') | mojo/public/c/system/message_pipe.h » ('j') | 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 15 matching lines...) Expand all
26 // for details about the right(s) required (some, like |MojoClose()|, require no 26 // for details about the right(s) required (some, like |MojoClose()|, require no
27 // rights). 27 // rights).
28 // |MOJO_HANDLE_RIGHT_NONE| - No rights. 28 // |MOJO_HANDLE_RIGHT_NONE| - No rights.
29 // |MOJO_HANDLE_RIGHT_DUPLICATE| - Right to duplicate a handle. 29 // |MOJO_HANDLE_RIGHT_DUPLICATE| - Right to duplicate a handle.
30 // |MOJO_HANDLE_RIGHT_TRANSFER| - Right to transfer a handle (e.g., include in 30 // |MOJO_HANDLE_RIGHT_TRANSFER| - Right to transfer a handle (e.g., include in
31 // a message). 31 // a message).
32 // |MOJO_HANDLE_RIGHT_READ| - Right to "read" from the handle (e.g., read a 32 // |MOJO_HANDLE_RIGHT_READ| - Right to "read" from the handle (e.g., read a
33 // message). 33 // message).
34 // |MOJO_HANDLE_RIGHT_WRITE| - Right to "write" to the handle (e.g., write a 34 // |MOJO_HANDLE_RIGHT_WRITE| - Right to "write" to the handle (e.g., write a
35 // message). 35 // message).
36 // |MOJO_HANDLE_RIGHT_EXECUTE| - Right to "execute" using the handle (e.g., 36 // |MOJO_HANDLE_RIGHT_GET_OPTIONS| - Right to get a handle's options.
37 // map a buffer as executable code). 37 // |MOJO_HANDLE_RIGHT_SET_OPTIONS| - Right to set a handle's options.
38 // 38 //
39 // TODO(vtl): Add rights support/checking to existing handle types. 39 // TODO(vtl): Add rights support/checking to existing handle types.
40 40
41 typedef uint32_t MojoHandleRights; 41 typedef uint32_t MojoHandleRights;
42 42
43 #define MOJO_HANDLE_RIGHT_NONE ((MojoHandleRights)0) 43 #define MOJO_HANDLE_RIGHT_NONE ((MojoHandleRights)0)
44 #define MOJO_HANDLE_RIGHT_DUPLICATE ((MojoHandleRights)1 << 0) 44 #define MOJO_HANDLE_RIGHT_DUPLICATE ((MojoHandleRights)1 << 0)
45 #define MOJO_HANDLE_RIGHT_TRANSFER ((MojoHandleRights)1 << 1) 45 #define MOJO_HANDLE_RIGHT_TRANSFER ((MojoHandleRights)1 << 1)
46 #define MOJO_HANDLE_RIGHT_READ ((MojoHandleRights)1 << 2) 46 #define MOJO_HANDLE_RIGHT_READ ((MojoHandleRights)1 << 2)
47 #define MOJO_HANDLE_RIGHT_WRITE ((MojoHandleRights)1 << 3) 47 #define MOJO_HANDLE_RIGHT_WRITE ((MojoHandleRights)1 << 3)
48 #define MOJO_HANDLE_RIGHT_EXECUTE ((MojoHandleRights)1 << 4) 48 #define MOJO_HANDLE_RIGHT_GET_OPTIONS ((MojoHandleRights)1 << 4)
49 #define MOJO_HANDLE_RIGHT_SET_OPTIONS ((MojoHandleRights)1 << 5)
49 50
50 // |MojoHandleSignals|: Used to specify signals that can be waited on for a 51 // |MojoHandleSignals|: Used to specify signals that can be waited on for a
51 // handle (and which can be triggered), e.g., the ability to read or write to 52 // handle (and which can be triggered), e.g., the ability to read or write to
52 // the handle. 53 // the handle.
53 // |MOJO_HANDLE_SIGNAL_NONE| - No flags. |MojoWait()|, etc. will return 54 // |MOJO_HANDLE_SIGNAL_NONE| - No flags. |MojoWait()|, etc. will return
54 // |MOJO_RESULT_FAILED_PRECONDITION| if you attempt to wait on this. 55 // |MOJO_RESULT_FAILED_PRECONDITION| if you attempt to wait on this.
55 // |MOJO_HANDLE_SIGNAL_READABLE| - Can read (e.g., a message) from the handle. 56 // |MOJO_HANDLE_SIGNAL_READABLE| - Can read (e.g., a message) from the handle.
56 // |MOJO_HANDLE_SIGNAL_WRITABLE| - Can write (e.g., a message) to the handle. 57 // |MOJO_HANDLE_SIGNAL_WRITABLE| - Can write (e.g., a message) to the handle.
57 // |MOJO_HANDLE_SIGNAL_PEER_CLOSED| - The peer handle is closed. 58 // |MOJO_HANDLE_SIGNAL_PEER_CLOSED| - The peer handle is closed.
58 // |MOJO_HANDLE_SIGNAL_READ_THRESHOLD| - Can read a certain amount of data 59 // |MOJO_HANDLE_SIGNAL_READ_THRESHOLD| - Can read a certain amount of data
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 // been reached. 174 // been reached.
174 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction 175 // |MOJO_RESULT_BUSY| if |handle| is currently in use in some transaction
175 // (that, e.g., may result in it being invalidated, such as being sent in 176 // (that, e.g., may result in it being invalidated, such as being sent in
176 // a message). 177 // a message).
177 MojoResult MojoDuplicateHandle(MojoHandle handle, 178 MojoResult MojoDuplicateHandle(MojoHandle handle,
178 MojoHandle* new_handle); // Out. 179 MojoHandle* new_handle); // Out.
179 180
180 MOJO_END_EXTERN_C 181 MOJO_END_EXTERN_C
181 182
182 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_ 183 #endif // MOJO_PUBLIC_C_SYSTEM_HANDLE_H_
OLDNEW
« no previous file with comments | « mojo/public/c/system/data_pipe.h ('k') | mojo/public/c/system/message_pipe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698