Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: mojo/public/cpp/bindings/tests/struct_with_traits_impl.h

Issue 2146153002: Mojo typemap config: support "copyable_pass_by_value" attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@69_change_move_only
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 bool bool_ = false; 84 bool bool_ = false;
85 uint32_t uint32_ = 0; 85 uint32_t uint32_ = 0;
86 uint64_t uint64_ = 0; 86 uint64_t uint64_ = 0;
87 std::string string_; 87 std::string string_;
88 std::vector<std::string> string_array_; 88 std::vector<std::string> string_array_;
89 NestedStructWithTraitsImpl struct_; 89 NestedStructWithTraitsImpl struct_;
90 std::vector<NestedStructWithTraitsImpl> struct_array_; 90 std::vector<NestedStructWithTraitsImpl> struct_array_;
91 std::map<std::string, NestedStructWithTraitsImpl> struct_map_; 91 std::map<std::string, NestedStructWithTraitsImpl> struct_map_;
92 }; 92 };
93 93
94 // A type which knows how to look like a mojo::test::PassByValueStructWithTraits 94 // A type which knows how to look like a mojo::test::TrivialStructWithTraits
95 // mojom type by way of mojo::StructTraits. 95 // mojom type by way of mojo::StructTraits.
96 class PassByValueStructWithTraitsImpl { 96 struct TrivialStructWithTraitsImpl {
97 int32_t value;
98 };
99
100 // A type which knows how to look like a mojo::test::MoveOnlyStructWithTraits
101 // mojom type by way of mojo::StructTraits.
102 class MoveOnlyStructWithTraitsImpl {
97 public: 103 public:
98 PassByValueStructWithTraitsImpl(); 104 MoveOnlyStructWithTraitsImpl();
99 PassByValueStructWithTraitsImpl(PassByValueStructWithTraitsImpl&& other); 105 MoveOnlyStructWithTraitsImpl(MoveOnlyStructWithTraitsImpl&& other);
100 ~PassByValueStructWithTraitsImpl(); 106 ~MoveOnlyStructWithTraitsImpl();
101 107
102 ScopedHandle& get_mutable_handle() { return handle_; } 108 ScopedHandle& get_mutable_handle() { return handle_; }
103 109
104 private: 110 private:
105 ScopedHandle handle_; 111 ScopedHandle handle_;
106 DISALLOW_COPY_AND_ASSIGN(PassByValueStructWithTraitsImpl); 112 DISALLOW_COPY_AND_ASSIGN(MoveOnlyStructWithTraitsImpl);
107 }; 113 };
108 114
109 } // namespace test 115 } // namespace test
110 } // namespace mojo 116 } // namespace mojo
111 117
112 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ 118 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/struct_with_traits.typemap ('k') | mojo/public/cpp/bindings/tests/struct_with_traits_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698