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

Unified Diff: mojo/public/c/bindings/message.h

Issue 2163793002: C bindings: Implement _Validate(), and some pre-requisites (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address comments Created 4 years, 5 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/public/c/bindings/map.h ('k') | mojo/public/c/bindings/struct.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/c/bindings/message.h
diff --git a/mojo/public/c/bindings/message.h b/mojo/public/c/bindings/message.h
index cec7b69f852ea1207c25fc3b9a64f9ae34f63777..bed1b81da259a9103060a7d8e3dd61862ff52532 100644
--- a/mojo/public/c/bindings/message.h
+++ b/mojo/public/c/bindings/message.h
@@ -50,12 +50,28 @@ MOJO_STATIC_ASSERT(sizeof(struct MojomMessageWithRequestId) == 24,
"MojomMessageWithRequestId must be 24 bytes");
// Validates that |in_buf| is a valid mojom message. This does not validate the
-// contents of the message's body, only the message header.
+// contents of the message's body, only the message header. This function does
+// not validate whether a message should be a kind of request.
// |in_buf|: can be a MojomMessage or a MojomMessageWithRequestId.
// |in_buf_size|: number of bytes in |in_buf|.
MojomValidationResult MojomMessage_ValidateHeader(const void* in_buf,
uint32_t in_buf_size);
+// Validates that the given message is a request expecting a response. Assumes
+// that the message is already validated by MojomMessage_ValidateHeader().
+MojomValidationResult MojomMessage_ValidateRequestExpectingResponse(
+ const void* in_buf);
+
+// Validates that the given message is a request which isn't expecting a
+// response. Assumes that the message is already validated by
+// MojomMessage_ValidateHeader().
+MojomValidationResult MojomMessage_ValidateRequestWithoutResponse(
+ const void* in_buf);
+
+// Validates that the given message is a response. Assumes taht the message is
+// already validated by MojomMessage_ValidateHeader().
+MojomValidationResult MojomMessage_ValidateResponse(const void* in_buf);
+
MOJO_END_EXTERN_C
#endif // MOJO_PUBLIC_C_BINDINGS_MESSAGE_H_
« no previous file with comments | « mojo/public/c/bindings/map.h ('k') | mojo/public/c/bindings/struct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698