| 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 types/constants and functions specific to message pipes. | 5 // This file contains types/constants and functions specific to message pipes. |
| 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_MESSAGE_PIPE_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ |
| 10 #define MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // |MojoWriteMessage()|: Writes a message to the message pipe endpoint given by | 83 // |MojoWriteMessage()|: Writes a message to the message pipe endpoint given by |
| 84 // |message_pipe_handle| (which must have the |MOJO_HANDLE_RIGHT_WRITE| right), | 84 // |message_pipe_handle| (which must have the |MOJO_HANDLE_RIGHT_WRITE| right), |
| 85 // with message data specified by |bytes| of size |num_bytes| and attached | 85 // with message data specified by |bytes| of size |num_bytes| and attached |
| 86 // handles specified by |handles| of count |num_handles|, and options specified | 86 // handles specified by |handles| of count |num_handles|, and options specified |
| 87 // by |flags|. If there is no message data, |bytes| may be null, in which case | 87 // by |flags|. If there is no message data, |bytes| may be null, in which case |
| 88 // |num_bytes| must be zero. If there are no attached handles, |handles| may be | 88 // |num_bytes| must be zero. If there are no attached handles, |handles| may be |
| 89 // null, in which case |num_handles| must be zero. | 89 // null, in which case |num_handles| must be zero. |
| 90 // | 90 // |
| 91 // If handles are attached, on success the handles will no longer be valid (the | 91 // If handles are attached, on success the handles will no longer be valid (the |
| 92 // receiver will receive equivalent, but logically different, handles). Handles | 92 // receiver will receive equivalent, but logically different, handles) and any |
| 93 // to be sent should not be in simultaneous use (e.g., on another thread). On | 93 // ongoing two-phase operations (e.g., for data pipes) on them will be aborted. |
| 94 // failure, any handles to be attached will remain valid. | 94 // Handles to be sent should not be in simultaneous use (e.g., on another |
| 95 // thread). On failure, any handles to be attached will remain valid (and |
| 96 // two-phase operations will not be aborted). |
| 95 // | 97 // |
| 96 // Returns: | 98 // Returns: |
| 97 // |MOJO_RESULT_OK| on success (i.e., the message was enqueued). | 99 // |MOJO_RESULT_OK| on success (i.e., the message was enqueued). |
| 98 // |MOJO_RESULT_INVALID_ARGUMENT| if some argument was invalid (e.g., if | 100 // |MOJO_RESULT_INVALID_ARGUMENT| if some argument was invalid (e.g., if |
| 99 // |message_pipe_handle| is not a valid handle, or some of the | 101 // |message_pipe_handle| is not a valid handle, or some of the |
| 100 // requirements above are not satisfied). | 102 // requirements above are not satisfied). |
| 101 // |MOJO_RESULT_PERMISSION_DENIED| if |message_pipe_handle| does not have the | 103 // |MOJO_RESULT_PERMISSION_DENIED| if |message_pipe_handle| does not have the |
| 102 // |MOJO_HANDLE_RIGHT_WRITE| right or if one of the handles to be sent | 104 // |MOJO_HANDLE_RIGHT_WRITE| right or if one of the handles to be sent |
| 103 // does not have the |MOJO_HANDLE_RIGHT_TRANSFER| right. | 105 // does not have the |MOJO_HANDLE_RIGHT_TRANSFER| right. |
| 104 // |MOJO_RESULT_RESOURCE_EXHAUSTED| if some system limit has been reached, or | 106 // |MOJO_RESULT_RESOURCE_EXHAUSTED| if some system limit has been reached, or |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 MojoHandle message_pipe_handle, // In. | 175 MojoHandle message_pipe_handle, // In. |
| 174 void* MOJO_RESTRICT bytes, // Optional out. | 176 void* MOJO_RESTRICT bytes, // Optional out. |
| 175 uint32_t* MOJO_RESTRICT num_bytes, // Optional in/out. | 177 uint32_t* MOJO_RESTRICT num_bytes, // Optional in/out. |
| 176 MojoHandle* MOJO_RESTRICT handles, // Optional out. | 178 MojoHandle* MOJO_RESTRICT handles, // Optional out. |
| 177 uint32_t* MOJO_RESTRICT num_handles, // Optional in/out. | 179 uint32_t* MOJO_RESTRICT num_handles, // Optional in/out. |
| 178 MojoReadMessageFlags flags); // In. | 180 MojoReadMessageFlags flags); // In. |
| 179 | 181 |
| 180 MOJO_END_EXTERN_C | 182 MOJO_END_EXTERN_C |
| 181 | 183 |
| 182 #endif // MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ | 184 #endif // MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ |
| OLD | NEW |