| 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_STRUCT_H_ | 5 #ifndef MOJO_PUBLIC_C_INCLUDE_MOJO_BINDINGS_STRUCT_H_ |
| 6 #define MOJO_PUBLIC_C_BINDINGS_STRUCT_H_ | 6 #define MOJO_PUBLIC_C_INCLUDE_MOJO_BINDINGS_STRUCT_H_ |
| 7 | 7 |
| 8 #include <mojo/bindings/buffer.h> |
| 9 #include <mojo/bindings/internal/type_descriptor.h> |
| 10 #include <mojo/bindings/internal/util.h> |
| 8 #include <mojo/macros.h> | 11 #include <mojo/macros.h> |
| 9 #include <stddef.h> | 12 #include <stddef.h> |
| 10 #include <stdint.h> | 13 #include <stdint.h> |
| 11 | 14 |
| 12 #include "mojo/public/c/bindings/buffer.h" | |
| 13 #include "mojo/public/c/bindings/lib/type_descriptor.h" | |
| 14 #include "mojo/public/c/bindings/lib/util.h" | |
| 15 | |
| 16 MOJO_BEGIN_EXTERN_C | 15 MOJO_BEGIN_EXTERN_C |
| 17 | 16 |
| 18 struct MojomStructHeader { | 17 struct MojomStructHeader { |
| 19 // |num_bytes| includes the size of this struct header along with the | 18 // |num_bytes| includes the size of this struct header along with the |
| 20 // accompanying struct data. |num_bytes| must be rounded up to 8 bytes. | 19 // accompanying struct data. |num_bytes| must be rounded up to 8 bytes. |
| 21 uint32_t num_bytes; | 20 uint32_t num_bytes; |
| 22 uint32_t version; | 21 uint32_t version; |
| 23 }; | 22 }; |
| 24 MOJO_STATIC_ASSERT(sizeof(struct MojomStructHeader) == 8, | 23 MOJO_STATIC_ASSERT(sizeof(struct MojomStructHeader) == 8, |
| 25 "struct MojomStructHeader must be 8 bytes."); | 24 "struct MojomStructHeader must be 8 bytes."); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // |in_type_desc|: Describes the pointer and handle fields of the mojom struct. | 98 // |in_type_desc|: Describes the pointer and handle fields of the mojom struct. |
| 100 // |in_struct|: The unencoded mojom struct to be copied. | 99 // |in_struct|: The unencoded mojom struct to be copied. |
| 101 // |out_struct|: Will be set to the new unencoded mojom struct. | 100 // |out_struct|: Will be set to the new unencoded mojom struct. |
| 102 bool MojomStruct_DeepCopy(struct MojomBuffer* buffer, | 101 bool MojomStruct_DeepCopy(struct MojomBuffer* buffer, |
| 103 const struct MojomTypeDescriptorStruct* in_type_desc, | 102 const struct MojomTypeDescriptorStruct* in_type_desc, |
| 104 const struct MojomStructHeader* in_struct, | 103 const struct MojomStructHeader* in_struct, |
| 105 struct MojomStructHeader** out_struct); | 104 struct MojomStructHeader** out_struct); |
| 106 | 105 |
| 107 MOJO_END_EXTERN_C | 106 MOJO_END_EXTERN_C |
| 108 | 107 |
| 109 #endif // MOJO_PUBLIC_C_BINDINGS_STRUCT_H_ | 108 #endif // MOJO_PUBLIC_C_INCLUDE_MOJO_BINDINGS_STRUCT_H_ |
| OLD | NEW |