| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_STRUCT_TRAITS_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_STRUCT_TRAITS_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_STRUCT_TRAITS_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 namespace mojo { | 8 namespace mojo { |
| 9 | 9 |
| 10 // This must be specialized for any type |T| to be serialized/deserialized as | 10 // This must be specialized for any type |T| to be serialized/deserialized as |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Supported by default: base::StringPiece, std::string, mojo::String, | 31 // Supported by default: base::StringPiece, std::string, mojo::String, |
| 32 // WTF::String (in blink). | 32 // WTF::String (in blink). |
| 33 // | 33 // |
| 34 // - array: | 34 // - array: |
| 35 // Value or reference of any type that has an ArrayTraits defined. | 35 // Value or reference of any type that has an ArrayTraits defined. |
| 36 // Supported by default: std::vector, CArray, mojo::Array, WTF::Vector | 36 // Supported by default: std::vector, CArray, mojo::Array, WTF::Vector |
| 37 // (in blink), mojo::WTFArray (in blink). | 37 // (in blink), mojo::WTFArray (in blink). |
| 38 // | 38 // |
| 39 // - map: | 39 // - map: |
| 40 // Value or reference of any type that has a MapTraits defined. | 40 // Value or reference of any type that has a MapTraits defined. |
| 41 // Supported by default: std::map, std::unordered_map, mojo::Map, | 41 // Supported by default: std::map, std::unordered_map, |
| 42 // WTF::HashMap (in blink). | 42 // WTF::HashMap (in blink). |
| 43 // | 43 // |
| 44 // - struct: | 44 // - struct: |
| 45 // Value or reference of any type that has a StructTraits defined. | 45 // Value or reference of any type that has a StructTraits defined. |
| 46 // | 46 // |
| 47 // - enum: | 47 // - enum: |
| 48 // Value of any type that has an EnumTraits defined. | 48 // Value of any type that has an EnumTraits defined. |
| 49 // | 49 // |
| 50 // For any nullable string/struct/array/map/union field you could also | 50 // For any nullable string/struct/array/map/union field you could also |
| 51 // return value or reference of base::Optional<T>/WTF::Optional<T>, if T | 51 // return value or reference of base::Optional<T>/WTF::Optional<T>, if T |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // | 157 // |
| 158 // static bool Read(FooDataView data, CustomFoo* output); | 158 // static bool Read(FooDataView data, CustomFoo* output); |
| 159 // }; | 159 // }; |
| 160 // | 160 // |
| 161 template <typename DataViewType, typename T> | 161 template <typename DataViewType, typename T> |
| 162 struct StructTraits; | 162 struct StructTraits; |
| 163 | 163 |
| 164 } // namespace mojo | 164 } // namespace mojo |
| 165 | 165 |
| 166 #endif // MOJO_PUBLIC_CPP_BINDINGS_STRUCT_TRAITS_H_ | 166 #endif // MOJO_PUBLIC_CPP_BINDINGS_STRUCT_TRAITS_H_ |
| OLD | NEW |