| 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 tries to |
| 318 // notify the embedder about the bad message, and the embedder may enforce some |
| 319 // policy for dealing with the source of the message (e.g. close the pipe, |
| 320 // terminate, a process, etc.) The embedder may not be notified if the calling |
| 321 // process has lost its connection to the source process. |
| 322 // |
| 323 // |message|: The message to report as bad. This must have come from a call to |
| 324 // |MojoReadMessageNew()|. |
| 325 // |error|: An error string which may provide the embedder with context when |
| 326 // notified of this error. |
| 327 // |error_num_bytes|: The length of |error| in bytes. |
| 328 // |
| 329 // Returns: |
| 330 // |MOJO_RESULT_OK| if successful. |
| 331 // |MOJO_RESULT_INVALID_ARGUMENT| if |message| is not a valid message. |
| 332 MOJO_SYSTEM_EXPORT MojoResult |
| 333 MojoNotifyBadMessage(MojoMessageHandle message, |
| 334 const char* error, |
| 335 size_t error_num_bytes); |
| 336 |
| 316 #ifdef __cplusplus | 337 #ifdef __cplusplus |
| 317 } // extern "C" | 338 } // extern "C" |
| 318 #endif | 339 #endif |
| 319 | 340 |
| 320 #endif // MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ | 341 #endif // MOJO_PUBLIC_C_SYSTEM_MESSAGE_PIPE_H_ |
| OLD | NEW |