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

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

Issue 473793004: Mojo C++ bindings: better log message for serialization warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/tools/bindings/generators/cpp_templates/interface_definition.tmpl ('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_serialization_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
index fb311cdf5d30999663a6300585d51ab0992aa86f..7a6d83de2b63f7d1fa45715a5494da4bed2c6c35 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_definition.tmpl
@@ -24,7 +24,8 @@ void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buf,
{%- if not pf.field.kind|is_nullable_kind %}
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
!result->{{pf.field.name}}.ptr,
- mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER);
+ mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
+ "null {{pf.field.name}} field in {{struct.name}} struct");
{%- endif %}
{%- elif pf.field.kind|is_any_handle_kind %}
{%- if pf.field.kind|is_interface_kind %}
@@ -35,7 +36,8 @@ void Serialize_({{struct.name}}Ptr input, mojo::internal::Buffer* buf,
{%- if not pf.field.kind|is_nullable_kind %}
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
!result->{{pf.field.name}}.is_valid(),
- mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE);
+ mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
+ "invalid {{pf.field.name}} field in {{struct.name}} struct");
{%- endif %}
{%- else %}
result->{{pf.field.name}} = input->{{pf.field.name}};
« no previous file with comments | « mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698