| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ |
| 7 | 7 |
| 8 #include "mojo/public/cpp/bindings/lib/interface_id.h" | 8 #include "mojo/public/cpp/bindings/lib/interface_id.h" |
| 9 #include "mojo/public/cpp/bindings/lib/template_util.h" | 9 #include "mojo/public/cpp/bindings/lib/template_util.h" |
| 10 #include "mojo/public/cpp/bindings/struct_ptr.h" | 10 #include "mojo/public/cpp/bindings/struct_ptr.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 static_assert(sizeof(ArrayHeader) == 8, "Bad_sizeof(ArrayHeader)"); | 31 static_assert(sizeof(ArrayHeader) == 8, "Bad_sizeof(ArrayHeader)"); |
| 32 | 32 |
| 33 template <typename T> | 33 template <typename T> |
| 34 union StructPointer { | 34 union StructPointer { |
| 35 uint64_t offset; | 35 uint64_t offset; |
| 36 T* ptr; | 36 T* ptr; |
| 37 }; | 37 }; |
| 38 static_assert(sizeof(StructPointer<char>) == 8, "Bad_sizeof(StructPointer)"); | 38 static_assert(sizeof(StructPointer<char>) == 8, "Bad_sizeof(StructPointer)"); |
| 39 | 39 |
| 40 template <typename T> | 40 template <typename T> |
| 41 union NativePointer { |
| 42 uint64_t offset; |
| 43 Array_Data<uint8_t>* ptr; |
| 44 }; |
| 45 static_assert(sizeof(NativePointer<char>) == sizeof(StructPointer<char>), |
| 46 "Bad_sizeof(NativePointer)"); |
| 47 |
| 48 template <typename T> |
| 41 union ArrayPointer { | 49 union ArrayPointer { |
| 42 uint64_t offset; | 50 uint64_t offset; |
| 43 Array_Data<T>* ptr; | 51 Array_Data<T>* ptr; |
| 44 }; | 52 }; |
| 45 static_assert(sizeof(ArrayPointer<char>) == 8, "Bad_sizeof(ArrayPointer)"); | 53 static_assert(sizeof(ArrayPointer<char>) == 8, "Bad_sizeof(ArrayPointer)"); |
| 46 | 54 |
| 47 using StringPointer = ArrayPointer<char>; | 55 using StringPointer = ArrayPointer<char>; |
| 48 static_assert(sizeof(StringPointer) == 8, "Bad_sizeof(StringPointer)"); | 56 static_assert(sizeof(StringPointer) == 8, "Bad_sizeof(StringPointer)"); |
| 49 | 57 |
| 50 | 58 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 }; | 131 }; |
| 124 template <typename S> | 132 template <typename S> |
| 125 struct WrapperTraits<S, true> { | 133 struct WrapperTraits<S, true> { |
| 126 typedef typename S::Data_* DataType; | 134 typedef typename S::Data_* DataType; |
| 127 }; | 135 }; |
| 128 | 136 |
| 129 } // namespace internal | 137 } // namespace internal |
| 130 } // namespace mojo | 138 } // namespace mojo |
| 131 | 139 |
| 132 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ | 140 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ |
| OLD | NEW |