| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/bindings/lib/interface_id.h" | 10 #include "mojo/public/cpp/bindings/lib/interface_id.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 typename S::Data_*>::type; | 152 typename S::Data_*>::type; |
| 153 }; | 153 }; |
| 154 template <typename S> | 154 template <typename S> |
| 155 struct GetDataTypeAsArrayElement<S, true> { | 155 struct GetDataTypeAsArrayElement<S, true> { |
| 156 using Data = | 156 using Data = |
| 157 typename std::conditional<IsUnionDataType<typename S::Data_>::value, | 157 typename std::conditional<IsUnionDataType<typename S::Data_>::value, |
| 158 typename S::Data_, | 158 typename S::Data_, |
| 159 typename S::Data_*>::type; | 159 typename S::Data_*>::type; |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 template <typename A> |
| 163 struct GetDataTypeAsArrayElement<std::unique_ptr<A>, true> { |
| 164 using Data = A; |
| 165 }; |
| 166 |
| 162 template <> | 167 template <> |
| 163 struct GetDataTypeAsArrayElement<String, false> { | 168 struct GetDataTypeAsArrayElement<String, false> { |
| 164 using Data = String_Data*; | 169 using Data = String_Data*; |
| 165 }; | 170 }; |
| 166 | 171 |
| 167 template <> | 172 template <> |
| 168 struct GetDataTypeAsArrayElement<WTF::String, false> { | 173 struct GetDataTypeAsArrayElement<WTF::String, false> { |
| 169 using Data = String_Data*; | 174 using Data = String_Data*; |
| 170 }; | 175 }; |
| 171 | 176 |
| 172 } // namespace internal | 177 } // namespace internal |
| 173 } // namespace mojo | 178 } // namespace mojo |
| 174 | 179 |
| 175 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ | 180 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDINGS_INTERNAL_H_ |
| OLD | NEW |