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

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

Issue 2031823002: Mojo C++ bindings: more consistent Clone() and Equals(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 18 matching lines...) Expand all
29 int32_t value = 0; 29 int32_t value = 0;
30 }; 30 };
31 31
32 // A type which knows how to look like a mojo::test::StructWithTraits mojom type 32 // A type which knows how to look like a mojo::test::StructWithTraits mojom type
33 // by way of mojo::StructTraits. 33 // by way of mojo::StructTraits.
34 class StructWithTraitsImpl { 34 class StructWithTraitsImpl {
35 public: 35 public:
36 StructWithTraitsImpl(); 36 StructWithTraitsImpl();
37 ~StructWithTraitsImpl(); 37 ~StructWithTraitsImpl();
38 38
39 StructWithTraitsImpl(const StructWithTraitsImpl& other);
40
39 void set_bool(bool value) { bool_ = value; } 41 void set_bool(bool value) { bool_ = value; }
40 bool get_bool() const { return bool_; } 42 bool get_bool() const { return bool_; }
41 43
42 void set_uint32(uint32_t value) { uint32_ = value; } 44 void set_uint32(uint32_t value) { uint32_ = value; }
43 uint32_t get_uint32() const { return uint32_; } 45 uint32_t get_uint32() const { return uint32_; }
44 46
45 void set_uint64(uint64_t value) { uint64_ = value; } 47 void set_uint64(uint64_t value) { uint64_ = value; }
46 uint64_t get_uint64() const { return uint64_; } 48 uint64_t get_uint64() const { return uint64_; }
47 49
48 void set_string(std::string value) { string_ = value; } 50 void set_string(std::string value) { string_ = value; }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 class PassByValueStructWithTraitsImpl { 90 class PassByValueStructWithTraitsImpl {
89 public: 91 public:
90 PassByValueStructWithTraitsImpl(); 92 PassByValueStructWithTraitsImpl();
91 PassByValueStructWithTraitsImpl(PassByValueStructWithTraitsImpl&& other); 93 PassByValueStructWithTraitsImpl(PassByValueStructWithTraitsImpl&& other);
92 ~PassByValueStructWithTraitsImpl(); 94 ~PassByValueStructWithTraitsImpl();
93 95
94 ScopedHandle& get_mutable_handle() { return handle_; } 96 ScopedHandle& get_mutable_handle() { return handle_; }
95 97
96 private: 98 private:
97 ScopedHandle handle_; 99 ScopedHandle handle_;
100 DISALLOW_COPY_AND_ASSIGN(PassByValueStructWithTraitsImpl);
98 }; 101 };
99 102
100 } // namespace test 103 } // namespace test
101 } // namespace mojo 104 } // namespace mojo
102 105
103 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_ 106 #endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/struct_traits_unittest.cc ('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