OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef MOJO_PUBLIC_C_BINDINGS_MESSAGE_H_ | 5 #ifndef MOJO_PUBLIC_C_INCLUDE_MOJO_BINDINGS_MESSAGE_H_ |
6 #define MOJO_PUBLIC_C_BINDINGS_MESSAGE_H_ | 6 #define MOJO_PUBLIC_C_INCLUDE_MOJO_BINDINGS_MESSAGE_H_ |
7 | 7 |
| 8 #include <mojo/bindings/struct.h> |
| 9 #include <mojo/bindings/validation.h> |
8 #include <mojo/macros.h> | 10 #include <mojo/macros.h> |
9 #include <stdint.h> | 11 #include <stdint.h> |
10 | 12 |
11 #include "mojo/public/c/bindings/struct.h" | |
12 #include "mojo/public/c/bindings/validation.h" | |
13 | |
14 MOJO_BEGIN_EXTERN_C | 13 MOJO_BEGIN_EXTERN_C |
15 | 14 |
16 #define MOJOM_MESSAGE_FLAGS_EXPECTS_RESPONSE ((uint32_t)(1 << 0u)) | 15 #define MOJOM_MESSAGE_FLAGS_EXPECTS_RESPONSE ((uint32_t)(1 << 0u)) |
17 #define MOJOM_MESSAGE_FLAGS_IS_RESPONSE ((uint32_t)(1 << 1u)) | 16 #define MOJOM_MESSAGE_FLAGS_IS_RESPONSE ((uint32_t)(1 << 1u)) |
18 | 17 |
19 // All mojom messages (over a message pipe) are framed with a MojomMessage as | 18 // All mojom messages (over a message pipe) are framed with a MojomMessage as |
20 // its header. | 19 // its header. |
21 // MojomMessage is actually a mojom struct -- we define it here since it's | 20 // MojomMessage is actually a mojom struct -- we define it here since it's |
22 // easier to read, and the validation has more to it than simple mojom struct | 21 // easier to read, and the validation has more to it than simple mojom struct |
23 // validation. | 22 // validation. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // MojomMessage_ValidateHeader(). | 66 // MojomMessage_ValidateHeader(). |
68 MojomValidationResult MojomMessage_ValidateRequestWithoutResponse( | 67 MojomValidationResult MojomMessage_ValidateRequestWithoutResponse( |
69 const void* in_buf); | 68 const void* in_buf); |
70 | 69 |
71 // Validates that the given message is a response. Assumes taht the message is | 70 // Validates that the given message is a response. Assumes taht the message is |
72 // already validated by MojomMessage_ValidateHeader(). | 71 // already validated by MojomMessage_ValidateHeader(). |
73 MojomValidationResult MojomMessage_ValidateResponse(const void* in_buf); | 72 MojomValidationResult MojomMessage_ValidateResponse(const void* in_buf); |
74 | 73 |
75 MOJO_END_EXTERN_C | 74 MOJO_END_EXTERN_C |
76 | 75 |
77 #endif // MOJO_PUBLIC_C_BINDINGS_MESSAGE_H_ | 76 #endif // MOJO_PUBLIC_C_INCLUDE_MOJO_BINDINGS_MESSAGE_H_ |
OLD | NEW |