| Index: mojo/public/cpp/bindings/lib/validation_util.h
|
| diff --git a/mojo/public/cpp/bindings/lib/validation_util.h b/mojo/public/cpp/bindings/lib/validation_util.h
|
| index 41049c03c9880168d6755ad4d6311dae0fe8fa88..4b3f0ab1b44b02b3b929a811320940562a060b53 100644
|
| --- a/mojo/public/cpp/bindings/lib/validation_util.h
|
| +++ b/mojo/public/cpp/bindings/lib/validation_util.h
|
| @@ -116,6 +116,19 @@ bool ValidateStruct(const StructPointer<T>& input,
|
| }
|
|
|
| template <typename T>
|
| +bool ValidateNative(const NativePointer<T>& input,
|
| + BoundsChecker* bounds_checker) {
|
| + if (!ValidateEncodedPointer(&input.offset)) {
|
| + ReportValidationError(VALIDATION_ERROR_ILLEGAL_POINTER);
|
| + return false;
|
| + }
|
| +
|
| + // Native types perform validation during deserialization.
|
| + DecodePointerRaw(&input.offset);
|
| + return true;
|
| +}
|
| +
|
| +template <typename T>
|
| bool ValidateInlinedUnion(const T& input, BoundsChecker* bounds_checker) {
|
| return T::Validate(&input, bounds_checker, true);
|
| }
|
|
|