| 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 93a2f62736cab3b239a9da9974306caea4806c45..45c57ec3971b39a590c007fd90f81f050b1b4fc4 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
|
| @@ -5,6 +5,41 @@
|
| #include "mojo/public/cpp/bindings/tests/struct_with_traits_impl_traits.h"
|
|
|
| namespace mojo {
|
| +namespace {
|
| +
|
| +struct Context {
|
| + int32_t value;
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +// static
|
| +void* StructTraits<test::NestedStructWithTraits,
|
| + test::NestedStructWithTraitsImpl>::
|
| + SetUpContext(const test::NestedStructWithTraitsImpl& input) {
|
| + Context* context = new Context;
|
| + context->value = input.value;
|
| + return context;
|
| +}
|
| +
|
| +// static
|
| +void StructTraits<test::NestedStructWithTraits,
|
| + test::NestedStructWithTraitsImpl>::
|
| + TearDownContext(const test::NestedStructWithTraitsImpl& input,
|
| + void* context) {
|
| + Context* context_obj = static_cast<Context*>(context);
|
| + CHECK_EQ(context_obj->value, input.value);
|
| + delete context_obj;
|
| +}
|
| +
|
| +// static
|
| +int32_t StructTraits<test::NestedStructWithTraits,
|
| + test::NestedStructWithTraitsImpl>::
|
| + value(const test::NestedStructWithTraitsImpl& input, void* context) {
|
| + Context* context_obj = static_cast<Context*>(context);
|
| + CHECK_EQ(context_obj->value, input.value);
|
| + return input.value;
|
| +}
|
|
|
| // static
|
| bool StructTraits<test::NestedStructWithTraits,
|
|
|