Chromium Code Reviews| Index: mojo/public/c/bindings/struct.h |
| diff --git a/mojo/public/c/bindings/struct.h b/mojo/public/c/bindings/struct.h |
| index 67798c3c3daaa3abe27c7a81d740de2fe1bfbc80..0fb188646abc7bf48a3db119ddc2695ee13cc322 100644 |
| --- a/mojo/public/c/bindings/struct.h |
| +++ b/mojo/public/c/bindings/struct.h |
| @@ -88,6 +88,21 @@ MojomValidationResult MojomStruct_Validate( |
| uint32_t in_num_handles, |
| struct MojomValidationContext* inout_context); |
| +// Creates a new copy of |in_struct| using |buffer| to allocate space. |
| +// Recursively creates new copies of any references from |in_struct|, and |
| +// updates the references to point to the new copies. All handles are moved |
| +// from |in_struct| to the new copy (the copies in |in_struct| are assigned an |
| +// invalid handle value). This operation is useful if you want to linearize |
| +// |in_struct| using the buffer backed by |buffer|. The new copy of the struct |
| +// is returned, and can then be encoded. |
| +// |buffer|: A mojom buffer used to allocate space for the new struct. |
|
viettrungluu
2016/08/02 20:15:06
(Same questions about the amount of space required
|
| +// |in_type_desc|: Describes the pointer and handle fields of the mojom struct. |
| +// |in_struct|: The unencoded mojom struct to be copied. |
| +struct MojomStructHeader* MojomStruct_DeepCopy( |
| + struct MojomBuffer* buffer, |
| + const struct MojomTypeDescriptorStruct* in_type_desc, |
| + struct MojomStructHeader* in_struct); |
| + |
| MOJO_END_EXTERN_C |
| #endif // MOJO_PUBLIC_C_BINDINGS_STRUCT_H_ |