Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl

Issue 494943004: Mojo C++ bindings: better log messages for some validation errors at the receiver side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
index 5ce9268e5f02abe14adde9915b57ea99b83b474a..0e5119323996ee8044a009aaa3eaaccd1c5fb21b 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
@@ -19,7 +19,8 @@
{%- if not kind|is_nullable_kind %}
if (!object->{{name}}.offset) {
ReportValidationError(
- mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER);
+ mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
+ "null {{name}} field in {{struct.name}} struct");
return false;
}
{%- endif %}
@@ -43,7 +44,8 @@
{%- if not kind|is_nullable_kind %}
if (object->{{name}}.value() == mojo::internal::kEncodedInvalidHandleValue) {
ReportValidationError(
- mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE);
+ mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
+ "invalid {{name}} field in {{struct.name}} struct");
return false;
}
{%- endif %}
« no previous file with comments | « mojo/public/cpp/bindings/lib/validation_errors.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698