Chromium Code Reviews| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 // | 306 // |
| 307 // Returns: | 307 // Returns: |
| 308 // |MOJO_RESULT_OK| if |message| is a valid message object. |*buffer| will | 308 // |MOJO_RESULT_OK| if |message| is a valid message object. |*buffer| will |
| 309 // be updated to point to mutable message bytes. | 309 // be updated to point to mutable message bytes. |
| 310 // |MOJO_RESULT_INVALID_ARGUMENT| if |message| is not a valid message object. | 310 // |MOJO_RESULT_INVALID_ARGUMENT| if |message| is not a valid message object. |
| 311 // | 311 // |
| 312 // NOTE: A returned buffer address is always guaranteed to be 8-byte aligned. | 312 // NOTE: A returned buffer address is always guaranteed to be 8-byte aligned. |
| 313 MOJO_SYSTEM_EXPORT MojoResult MojoGetMessageBuffer(MojoMessageHandle message, | 313 MOJO_SYSTEM_EXPORT MojoResult MojoGetMessageBuffer(MojoMessageHandle message, |
| 314 void** buffer); // Out | 314 void** buffer); // Out |
| 315 | 315 |
| 316 // Notifies the system that a bad message was received on a message pipe, | |
| 317 // according to whatever criteria the caller chooses. This ultimately notifies | |
| 318 // the embedder about the bad message, and the embedder may enforce some policy | |
| 319 // for dealing with the source of the message (e.g. close the pipe, terminate | |
| 320 // a process, etc.) | |
| 321 // | |
| 322 // |message|: The message to report as bad. This must have come from a call to | |
| 323 // |MojoReadMessageNew()|. | |
| 324 // | |
| 325 // Returns: | |
| 326 // |MOJO_RESULT_OK| if successful. | |
| 327 // |MOJO_RESULT_INVALID_ARGUMENT| if |message| is not a valid message. | |
|
Anand Mistry (off Chromium)
2016/06/10 10:28:20
Add a note that the bad message callback may not b
| |
| 328 MOJO_SYSTEM_EXPORT MojoResult | |
| 329 MojoNotifyBadMessage(MojoMessageHandle message); | |
| 330 | |
| 316 #ifdef __cplusplus | 331 #ifdef __cplusplus |
| 317 } // extern "C" | 332 } // extern "C" |
| 318 #endif | 333 #endif |
| 319 | 334 |
| 320 #endif // MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ | 335 #endif // MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ |
| OLD | NEW |