Mojo cpp bindings: report the reason of validation failure.
commit664e97e4884e31263bf5b775e93076b3f62b7427
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 4 Jun 2014 17:29:22 +0000 (4 17:29 +0000)
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 4 Jun 2014 17:29:22 +0000 (4 17:29 +0000)
treea8561536272d1f1877a6c85500a9363409738acb
parent55b5d15b3d371a85b9cbbb4cecd42d751949c820
Mojo cpp bindings: report the reason of validation failure.

Validation errors are written to stderr and also used in validation tests.
This CL also changes MessageHeaderValidator to use the same struct header
validation code as other structs.

BUG=None
TEST=validation_unittest.cc
R=darin@chromium.org

Review URL: https://codereview.chromium.org/307353009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274855 0039d316-1c4b-4281-b951-d872f2087c98
14 files changed:
mojo/mojo_public.gypi
mojo/public/cpp/bindings/BUILD.gn
mojo/public/cpp/bindings/lib/array_internal.cc
mojo/public/cpp/bindings/lib/array_internal.h
mojo/public/cpp/bindings/lib/bindings_serialization.cc
mojo/public/cpp/bindings/lib/message_header_validator.cc
mojo/public/cpp/bindings/lib/validation_errors.cc [new file with mode: 0644]
mojo/public/cpp/bindings/lib/validation_errors.h [new file with mode: 0644]
mojo/public/cpp/bindings/tests/validation_unittest.cc
mojo/public/interfaces/bindings/tests/data/validate_header_bad_empty.expected
mojo/public/interfaces/bindings/tests/data/validate_header_bad_too_small.expected
mojo/public/interfaces/bindings/tests/data/validate_header_bad_zeros.expected
mojo/public/tools/bindings/generators/cpp_templates/module.cc.tmpl
mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl