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_CPP_BINDINGS_NATIVE_STRUCT_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ |
7 | 7 |
8 #include "mojo/public/cpp/bindings/array.h" | 8 #include <vector> |
| 9 |
| 10 #include "base/optional.h" |
9 #include "mojo/public/cpp/bindings/bindings_export.h" | 11 #include "mojo/public/cpp/bindings/bindings_export.h" |
10 #include "mojo/public/cpp/bindings/lib/native_struct_data.h" | 12 #include "mojo/public/cpp/bindings/lib/native_struct_data.h" |
11 #include "mojo/public/cpp/bindings/struct_ptr.h" | 13 #include "mojo/public/cpp/bindings/struct_ptr.h" |
12 #include "mojo/public/cpp/bindings/type_converter.h" | 14 #include "mojo/public/cpp/bindings/type_converter.h" |
13 | 15 |
14 namespace mojo { | 16 namespace mojo { |
15 | 17 |
16 class NativeStruct; | 18 class NativeStruct; |
17 using NativeStructPtr = StructPtr<NativeStruct>; | 19 using NativeStructPtr = StructPtr<NativeStruct>; |
18 | 20 |
(...skipping 15 matching lines...) Expand all Loading... |
34 return TypeConverter<U, NativeStruct>::Convert(*this); | 36 return TypeConverter<U, NativeStruct>::Convert(*this); |
35 } | 37 } |
36 | 38 |
37 NativeStruct(); | 39 NativeStruct(); |
38 ~NativeStruct(); | 40 ~NativeStruct(); |
39 | 41 |
40 NativeStructPtr Clone() const; | 42 NativeStructPtr Clone() const; |
41 bool Equals(const NativeStruct& other) const; | 43 bool Equals(const NativeStruct& other) const; |
42 size_t Hash(size_t seed) const; | 44 size_t Hash(size_t seed) const; |
43 | 45 |
44 Array<uint8_t> data; | 46 base::Optional<std::vector<uint8_t>> data; |
45 }; | 47 }; |
46 | 48 |
47 } // namespace mojo | 49 } // namespace mojo |
48 | 50 |
49 #endif // MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ | 51 #endif // MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ |
OLD | NEW |