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

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: 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
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..b9aca2887778f9bdd3768a476eaf686d5c163d01 100644
--- a/mojo/public/c/system/message_pipe.h
+++ b/mojo/public/c/system/message_pipe.h
@@ -313,6 +313,21 @@ 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 notifies
+// 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.)
+//
+// |message|: The message to report as bad. This must have come from a call to
+// |MojoReadMessageNew()|.
+//
+// Returns:
+// |MOJO_RESULT_OK| if successful.
+// |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
+MOJO_SYSTEM_EXPORT MojoResult
+MojoNotifyBadMessage(MojoMessageHandle message);
+
#ifdef __cplusplus
} // extern "C"
#endif

Powered by Google App Engine
This is Rietveld 408576698