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

Unified Diff: mojo/public/c/system/message_pipe.h

Issue 2043713004: Mojo: Add NotifyBadMessage API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no bindings Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/system/message_pipe.h
diff --git a/mojo/public/c/system/message_pipe.h b/mojo/public/c/system/message_pipe.h
index d41e107a9922b5442957fce5219b7f57cdff7455..b759bc73db4927826ec684ae58fd0947b6c82408 100644
--- a/mojo/public/c/system/message_pipe.h
+++ b/mojo/public/c/system/message_pipe.h
@@ -313,6 +313,27 @@ MOJO_SYSTEM_EXPORT MojoResult MojoFreeMessage(MojoMessageHandle message);
MOJO_SYSTEM_EXPORT MojoResult MojoGetMessageBuffer(MojoMessageHandle message,
void** buffer); // Out
+// Notifies the system that a bad message was received on a message pipe,
+// according to whatever criteria the caller chooses. This ultimately tries to
+// notify the embedder about the bad message, and the embedder may enforce some
+// policy for dealing with the source of the message (e.g. close the pipe,
+// terminate, a process, etc.) The embedder may not be notified if the calling
+// process has lost its connection to the source process.
+//
+// |message|: The message to report as bad. This must have come from a call to
+// |MojoReadMessageNew()|.
+// |error|: An error string which may provide the embedder with context when
+// notified of this error.
+// |error_num_bytes|: The length of |error| in bytes.
+//
+// Returns:
+// |MOJO_RESULT_OK| if successful.
+// |MOJO_RESULT_INVALID_ARGUMENT| if |message| is not a valid message.
+MOJO_SYSTEM_EXPORT MojoResult
+MojoNotifyBadMessage(MojoMessageHandle message,
+ const char* error,
+ size_t error_num_bytes);
+
#ifdef __cplusplus
} // extern "C"
#endif
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper.cc ('k') | mojo/public/c/system/thunks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698