| Index: mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc
|
| diff --git a/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc
|
| index 700368e83eaee928a7e4cba14e26fb03ecb734b0..93a2f62736cab3b239a9da9974306caea4806c45 100644
|
| --- a/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc
|
| +++ b/mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.cc
|
| @@ -7,17 +7,40 @@
|
| namespace mojo {
|
|
|
| // static
|
| +bool StructTraits<test::NestedStructWithTraits,
|
| + test::NestedStructWithTraitsImpl>::
|
| + Read(test::NestedStructWithTraitsDataView data,
|
| + test::NestedStructWithTraitsImpl* output) {
|
| + output->value = data.value();
|
| + return true;
|
| +}
|
| +
|
| +// static
|
| bool StructTraits<test::StructWithTraits, test::StructWithTraitsImpl>::Read(
|
| test::StructWithTraitsDataView data,
|
| test::StructWithTraitsImpl* out) {
|
| out->set_bool(data.f_bool());
|
| out->set_uint32(data.f_uint32());
|
| out->set_uint64(data.f_uint64());
|
| - base::StringPiece f_string, f_string2;
|
| - if (!data.ReadFString(&f_string) || !data.ReadFString2(&f_string2))
|
| +
|
| + base::StringPiece f_string;
|
| + std::string f_string2;
|
| + if (!data.ReadFString(&f_string) || !data.ReadFString2(&f_string2) ||
|
| + f_string != f_string2) {
|
| + return false;
|
| + }
|
| + out->set_string(f_string2);
|
| +
|
| + if (!data.ReadFStringArray(&out->get_mutable_string_array()))
|
| return false;
|
| - out->set_string(f_string.as_string());
|
| - return f_string == f_string2;
|
| +
|
| + if (!data.ReadFStruct(&out->get_mutable_struct()))
|
| + return false;
|
| +
|
| + if (!data.ReadFStructArray(&out->get_mutable_struct_array()))
|
| + return false;
|
| +
|
| + return true;
|
| }
|
|
|
| } // namespace mojo
|
|
|