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

Unified Diff: mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h

Issue 1821073002: Mojo bindings: Fix typemap includes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
similarity index 52%
copy from mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
copy to mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
index d56dae593ee7142ef60053fd70120e4d4cd1a00f..94330525483ccbfaf12d171434c5a70c8bfbe450 100644
--- a/mojo/public/cpp/bindings/tests/struct_with_traits_impl.h
+++ b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_TRAITS_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_TRAITS_H_
#include <stdint.h>
@@ -11,42 +11,9 @@
#include "base/strings/string_piece.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
+#include "mojo/public/cpp/bindings/tests/struct_with_traits_impl.h"
namespace mojo {
-namespace test {
-
-// The mojom types are forward-declared to avoid circular dependencies between
-// this and generated headers.
-class StructWithTraits;
-class StructWithTraits_Reader;
-
-// A type which knows how to look like a mojo::test::StructWithTraits mojom type
-// by way of mojo::StructTraits.
-class StructWithTraitsImpl {
- public:
- StructWithTraitsImpl();
- ~StructWithTraitsImpl();
-
- void set_bool(bool value) { bool_ = value; }
- bool get_bool() const { return bool_; }
-
- void set_uint32(uint32_t value) { uint32_ = value; }
- uint32_t get_uint32() const { return uint32_; }
-
- void set_uint64(uint64_t value) { uint64_ = value; }
- uint64_t get_uint64() const { return uint64_; }
-
- void set_string(std::string value) { string_ = value; }
- base::StringPiece get_string() const { return string_; }
-
- private:
- bool bool_ = false;
- uint32_t uint32_ = 0;
- uint64_t uint64_ = 0;
- std::string string_;
-};
-
-} // namespace test
template <>
struct StructTraits<test::StructWithTraits, test::StructWithTraitsImpl> {
@@ -75,4 +42,4 @@ struct StructTraits<test::StructWithTraits, test::StructWithTraitsImpl> {
} // namespace mojo
-#endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_H_
+#endif // MOJO_PUBLIC_CPP_BINDINGS_TESTS_STRUCT_WITH_TRAITS_IMPL_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698