| 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..038aab2b989f2837da0a188ca8e0fb646c20e844 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::StructWithTraitsElement,
|
| + test::StructWithTraitsElementImpl>::
|
| + Read(test::StructWithTraitsElementDataView data,
|
| + test::StructWithTraitsElementImpl* 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.ReadFArrayString(&out->get_mutable_array_string()))
|
| return false;
|
| - out->set_string(f_string.as_string());
|
| - return f_string == f_string2;
|
| +
|
| + if (!data.ReadFElement(&out->get_mutable_element()))
|
| + return false;
|
| +
|
| + if (!data.ReadFArrayElement(&out->get_mutable_array_element()))
|
| + return false;
|
| +
|
| + return true;
|
| }
|
|
|
| } // namespace mojo
|
|
|