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

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

Issue 1520153002: [mojo] Allow value deserialization to fail (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindings-3-misc-support
Patch Set: Created 5 years 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
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 f28948aab179fafae4b28a5638cafca67b68d79b..bb0d9c2010b95de9c6fcefa2b3b1a0f54cf1aed9 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
@@ -133,9 +133,11 @@
{%- endif %}
{%- if kind|is_object_kind %}
{%- if kind|is_union_kind %}
- Deserialize_(&{{input}}->{{name}}, &{{output_field}}, {{context}});
+ if (!Deserialize_(&{{input}}->{{name}}, &{{output_field}}, {{context}}))
+ return false;
{%- else %}
- Deserialize_({{input}}->{{name}}.ptr, &{{output_field}}, {{context}});
+ if (!Deserialize_({{input}}->{{name}}.ptr, &{{output_field}}, {{context}}))
+ return false;
{%- endif %}
{%- elif kind|is_interface_kind %}
mojo::internal::InterfaceDataToPointer(&{{input}}->{{name}}, &{{output_field}});

Powered by Google App Engine
This is Rietveld 408576698