| Index: mojo/public/cpp/bindings/lib/serialization.h
|
| diff --git a/mojo/public/cpp/bindings/lib/serialization.h b/mojo/public/cpp/bindings/lib/serialization.h
|
| index 359b02b77c25a55636560bb7d94f28e28a0bf702..2a7d288d55492322ab451052e727d3fbb18c349c 100644
|
| --- a/mojo/public/cpp/bindings/lib/serialization.h
|
| +++ b/mojo/public/cpp/bindings/lib/serialization.h
|
| @@ -64,7 +64,10 @@ DataArrayType StructSerializeImpl(UserType* input) {
|
| }
|
|
|
| template <typename MojomType, typename DataArrayType, typename UserType>
|
| -bool StructDeserializeImpl(const DataArrayType& input, UserType* output) {
|
| +bool StructDeserializeImpl(const DataArrayType& input,
|
| + UserType* output,
|
| + bool (*validate_func)(const void*,
|
| + ValidationContext*)) {
|
| static_assert(BelongsTo<MojomType, MojomTypeCategory::STRUCT>::value,
|
| "Unexpected type.");
|
| using DataType = typename MojomTypeTraits<MojomType>::Data;
|
| @@ -86,7 +89,7 @@ bool StructDeserializeImpl(const DataArrayType& input, UserType* output) {
|
|
|
| ValidationContext validation_context(input_buffer, input.size(), 0, 0);
|
| bool result = false;
|
| - if (DataType::Validate(input_buffer, &validation_context)) {
|
| + if (validate_func(input_buffer, &validation_context)) {
|
| auto data = reinterpret_cast<DataType*>(input_buffer);
|
| SerializationContext context;
|
| result = Deserialize<MojomType>(data, output, &context);
|
|
|