Mojo: Add warning of invalid serialization results (in debug build).
commite91bcab904f1bd770b2b634e613eea887b606f04
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 19 Aug 2014 04:28:34 +0000 (19 04:28 +0000)
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 19 Aug 2014 04:29:33 +0000 (19 04:29 +0000)
treed341d12c9d4c355bae432b5fc109095955a0a503
parent3d69a81b67f0c45c17c5245a4d1a8fb3ae86acf0
Mojo: Add warning of invalid serialization results (in debug build).

A fatal-level message is logged if:
- a fixed-size array has wrong number of elements;
- a non-nullable field is set to null (or invalid handle).

BUG=324170
TEST=SerializationWarningTest.*

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

Cr-Commit-Position: refs/heads/master@{#290487}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290487 0039d316-1c4b-4281-b951-d872f2087c98
15 files changed:
mojo/mojo_public_tests.gypi
mojo/public/cpp/bindings/lib/array_internal.h
mojo/public/cpp/bindings/lib/array_serialization.h
mojo/public/cpp/bindings/lib/validation_errors.cc
mojo/public/cpp/bindings/lib/validation_errors.h
mojo/public/cpp/bindings/tests/array_unittest.cc
mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc [new file with mode: 0644]
mojo/public/cpp/bindings/tests/struct_unittest.cc
mojo/public/interfaces/bindings/tests/BUILD.gn
mojo/public/interfaces/bindings/tests/serialization_test_structs.mojom [new file with mode: 0644]
mojo/public/interfaces/bindings/tests/test_structs.mojom
mojo/public/java/bindings/src/org/chromium/mojo/bindings/Decoder.java
mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
mojo/public/tools/bindings/generators/mojom_cpp_generator.py