| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // |inout_handles|: Mojo handles are moved out of this array, and are references | 88 // |inout_handles|: Mojo handles are moved out of this array, and are references |
| 89 // by index in |inout_buf|. | 89 // by index in |inout_buf|. |
| 90 // |in_num_handles|: Size in # of number elements available in |inout_handles|. | 90 // |in_num_handles|: Size in # of number elements available in |inout_handles|. |
| 91 void MojomArray_DecodePointersAndHandles( | 91 void MojomArray_DecodePointersAndHandles( |
| 92 const struct MojomTypeDescriptorArray* in_type_desc, | 92 const struct MojomTypeDescriptorArray* in_type_desc, |
| 93 struct MojomArrayHeader* inout_array, | 93 struct MojomArrayHeader* inout_array, |
| 94 uint32_t in_array_size, | 94 uint32_t in_array_size, |
| 95 MojoHandle* inout_handles, | 95 MojoHandle* inout_handles, |
| 96 uint32_t in_num_handles); | 96 uint32_t in_num_handles); |
| 97 | 97 |
| 98 // Validates the mojom array described by the |in_struct| buffer. Any |
| 99 // references from the array are also recursively validated, and are expected |
| 100 // to be in the same buffer backing |in_array|. |
| 101 // |in_type_desc|: Describes the pointer and handle fields of the mojom array. |
| 102 // |in_array|: Buffer containing the array, and any other references outside of |
| 103 // the array |
| 104 // |in_array_size|: Size of the buffer backed by |in_array| in bytes. |
| 105 // |in_num_handles|: Number of valid handles expected to be referenced from |
| 106 // |in_array|. |
| 107 // |inout_context|: An initialized context that contains the expected location |
| 108 // of the next pointer and next offset. This is used to |
| 109 // validate that no two pointers or handles are shared. |
| 110 MojomValidationResult MojomArray_Validate( |
| 111 const struct MojomTypeDescriptorArray* in_type_desc, |
| 112 const struct MojomArrayHeader* in_array, |
| 113 uint32_t in_array_size, |
| 114 uint32_t in_num_handles, |
| 115 struct MojomValidationContext* inout_context); |
| 116 |
| 98 MOJO_END_EXTERN_C | 117 MOJO_END_EXTERN_C |
| 99 | 118 |
| 100 #endif // MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ | 119 #endif // MOJO_PUBLIC_C_BINDINGS_ARRAY_H_ |
| OLD | NEW |