| Index: mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
|
| diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
|
| index 4550526d7bb5f263bd36034b55e3ea66905365f8..fe88462014a89b7d4e1ed06a4aa87423d46ede6e 100644
|
| --- a/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
|
| +++ b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h
|
| @@ -93,15 +93,32 @@ struct StructTraits<test::StructWithTraits, test::StructWithTraitsImpl> {
|
| };
|
|
|
| template <>
|
| -struct StructTraits<test::PassByValueStructWithTraits,
|
| - test::PassByValueStructWithTraitsImpl> {
|
| - // Deserialization to test::PassByValueStructTraitsImpl.
|
| - static bool Read(test::PassByValueStructWithTraits::DataView data,
|
| - test::PassByValueStructWithTraitsImpl* out);
|
| +struct StructTraits<test::TrivialStructWithTraits,
|
| + test::TrivialStructWithTraitsImpl> {
|
| + // Deserialization to test::TrivialStructTraitsImpl.
|
| + static bool Read(test::TrivialStructWithTraits::DataView data,
|
| + test::TrivialStructWithTraitsImpl* out) {
|
| + out->value = data.value();
|
| + return true;
|
| + }
|
| +
|
| + // Fields in test::TrivialStructWithTraits.
|
| + // See src/mojo/public/interfaces/bindings/tests/struct_with_traits.mojom.
|
| + static int32_t value(test::TrivialStructWithTraitsImpl& input) {
|
| + return input.value;
|
| + }
|
| +};
|
| +
|
| +template <>
|
| +struct StructTraits<test::MoveOnlyStructWithTraits,
|
| + test::MoveOnlyStructWithTraitsImpl> {
|
| + // Deserialization to test::MoveOnlyStructTraitsImpl.
|
| + static bool Read(test::MoveOnlyStructWithTraits::DataView data,
|
| + test::MoveOnlyStructWithTraitsImpl* out);
|
|
|
| - // Fields in test::PassByValueStructWithTraits.
|
| + // Fields in test::MoveOnlyStructWithTraits.
|
| // See src/mojo/public/interfaces/bindings/tests/struct_with_traits.mojom.
|
| - static ScopedHandle f_handle(test::PassByValueStructWithTraitsImpl& value) {
|
| + static ScopedHandle f_handle(test::MoveOnlyStructWithTraitsImpl& value) {
|
| return std::move(value.get_mutable_handle());
|
| }
|
| };
|
|
|