| 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 #include "mojo/public/c/bindings/lib/type_descriptor.h" | 5 #include "mojo/public/c/bindings/lib/type_descriptor.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "mojo/public/c/bindings/array.h" | 10 #include "mojo/public/c/bindings/array.h" |
| 11 #include "mojo/public/c/bindings/interface.h" | 11 #include "mojo/public/c/bindings/interface.h" |
| 12 #include "mojo/public/c/bindings/lib/util.h" | 12 #include "mojo/public/c/bindings/lib/util.h" |
| 13 #include "mojo/public/c/bindings/map.h" | 13 #include "mojo/public/c/bindings/map.h" |
| 14 #include "mojo/public/c/bindings/struct.h" | 14 #include "mojo/public/c/bindings/struct.h" |
| 15 #include "mojo/public/c/bindings/union.h" | 15 #include "mojo/public/c/bindings/union.h" |
| 16 | 16 |
| 17 const struct MojomTypeDescriptorArray g_mojom_string_type_description = { | 17 const struct MojomTypeDescriptorArray g_mojom_string_type_description = { |
| 18 MOJOM_TYPE_DESCRIPTOR_TYPE_POD, // elem_type | 18 .elem_type = MOJOM_TYPE_DESCRIPTOR_TYPE_POD, |
| 19 NULL, // elem_descriptor | 19 .elem_descriptor = NULL, |
| 20 0, // num_elements | 20 .num_elements = 0, |
| 21 8, // elem_num_bits | 21 .elem_num_bits = 8, |
| 22 false, // nullable | 22 .nullable = false, |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 // The encoding of a MojoHandle is an index into an array of Handles. A | 25 // The encoding of a MojoHandle is an index into an array of Handles. A |
| 26 // null/invalid handle is encoded as index (which is unsigned) "-1", which | 26 // null/invalid handle is encoded as index (which is unsigned) "-1", which |
| 27 // equates to the highest possible index. | 27 // equates to the highest possible index. |
| 28 static const MojoHandle kEncodedHandleInvalid = (MojoHandle)-1; | 28 static const MojoHandle kEncodedHandleInvalid = (MojoHandle)-1; |
| 29 | 29 |
| 30 bool MojomType_IsPointer(enum MojomTypeDescriptorType type) { | 30 bool MojomType_IsPointer(enum MojomTypeDescriptorType type) { |
| 31 return type == MOJOM_TYPE_DESCRIPTOR_TYPE_STRUCT_PTR || | 31 return type == MOJOM_TYPE_DESCRIPTOR_TYPE_STRUCT_PTR || |
| 32 type == MOJOM_TYPE_DESCRIPTOR_TYPE_MAP_PTR || | 32 type == MOJOM_TYPE_DESCRIPTOR_TYPE_MAP_PTR || |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 in_union_data, | 451 in_union_data, |
| 452 out_union_data); | 452 out_union_data); |
| 453 case MOJOM_TYPE_DESCRIPTOR_TYPE_HANDLE: | 453 case MOJOM_TYPE_DESCRIPTOR_TYPE_HANDLE: |
| 454 case MOJOM_TYPE_DESCRIPTOR_TYPE_INTERFACE: | 454 case MOJOM_TYPE_DESCRIPTOR_TYPE_INTERFACE: |
| 455 case MOJOM_TYPE_DESCRIPTOR_TYPE_POD: | 455 case MOJOM_TYPE_DESCRIPTOR_TYPE_POD: |
| 456 break; | 456 break; |
| 457 } | 457 } |
| 458 | 458 |
| 459 return true; | 459 return true; |
| 460 } | 460 } |
| OLD | NEW |