Chromium Code Reviews| 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_ARRAY_H_ | 5 #ifndef MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ |
| 6 #define MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ | 6 #define MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "mojo/public/c/bindings/buffer.h" | 10 #include "mojo/public/c/bindings/buffer.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 // |inout_context|: An initialized context that contains the expected location | 107 // |inout_context|: An initialized context that contains the expected location |
| 108 // of the next pointer and next offset. This is used to | 108 // of the next pointer and next offset. This is used to |
| 109 // validate that no two pointers or handles are shared. | 109 // validate that no two pointers or handles are shared. |
| 110 MojomValidationResult MojomArray_Validate( | 110 MojomValidationResult MojomArray_Validate( |
| 111 const struct MojomTypeDescriptorArray* in_type_desc, | 111 const struct MojomTypeDescriptorArray* in_type_desc, |
| 112 const struct MojomArrayHeader* in_array, | 112 const struct MojomArrayHeader* in_array, |
| 113 uint32_t in_array_size, | 113 uint32_t in_array_size, |
| 114 uint32_t in_num_handles, | 114 uint32_t in_num_handles, |
| 115 struct MojomValidationContext* inout_context); | 115 struct MojomValidationContext* inout_context); |
| 116 | 116 |
| 117 // Creates a new copy of |in_array| using |buffer| to allocate space. | |
| 118 // Recursively creates new copies of any references from |in_array|, and | |
| 119 // updates the references to point to the new copies. All handles are moved | |
| 120 // from |in_array| to the new copy (the copies in |in_array| are assigned an | |
| 121 // invalid handle value). This operation is useful if you want to linearize | |
| 122 // |in_array| using the buffer backed by |buffer|. The new copy of the array | |
| 123 // is returned. | |
| 124 // |buffer|: A mojom buffer used to allocate space for the new array. | |
|
viettrungluu
2016/08/02 20:15:06
What's the size/space requirement on |buffer|?
| |
| 125 // |in_type_desc|: Describes the pointer and handle fields of the mojom array. | |
| 126 // |in_array|: The unencoded mojom array to be copied. | |
| 127 struct MojomArrayHeader* MojomArray_DeepCopy( | |
| 128 struct MojomBuffer* buffer, | |
| 129 const struct MojomTypeDescriptorArray* in_type_desc, | |
| 130 struct MojomArrayHeader* in_array); | |
| 131 | |
| 117 MOJO_END_EXTERN_C | 132 MOJO_END_EXTERN_C |
| 118 | 133 |
| 119 #endif // MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ | 134 #endif // MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ |
| OLD | NEW |