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

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

Issue 131033002: Mojo: Simplify object serialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix indentation error Created 6 years, 11 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
Index: mojo/public/bindings/generators/cpp_templates/struct_macros.tmpl
diff --git a/mojo/public/bindings/generators/cpp_templates/struct_macros.tmpl b/mojo/public/bindings/generators/cpp_templates/struct_macros.tmpl
index 538f7f15d04039f8b15e8121698e4cd9c0c5c85a..9e7706d72242538eb2811fd4ac64b60a4db5b4d3 100644
--- a/mojo/public/bindings/generators/cpp_templates/struct_macros.tmpl
+++ b/mojo/public/bindings/generators/cpp_templates/struct_macros.tmpl
@@ -61,22 +61,22 @@
{%- endif %}
{%- endmacro %}
-{%- macro encodes(struct, param_name) -%}
+{%- macro encodes(struct) -%}
{%- for pf in struct.packed.packed_fields if pf.field.kind|is_object_kind -%}
-Encode(&{{param_name}}->{{pf.field.name}}_, handles);
+mojo::internal::Encode(&{{pf.field.name}}_, handles);
{% endfor %}
{%- for pf in struct.packed.packed_fields if pf.field.kind|is_handle_kind -%}
-EncodeHandle(&{{param_name}}->{{pf.field.name}}_, handles);
+mojo::internal::EncodeHandle(&{{pf.field.name}}_, handles);
{% endfor %}
{%- endmacro -%}
-{%- macro decodes(struct, param_name) -%}
+{%- macro decodes(struct) -%}
{%- for pf in struct.packed.packed_fields if pf.field.kind|is_object_kind -%}
-if (!Decode(&{{param_name}}->{{pf.field.name}}_, message))
+if (!mojo::internal::Decode(&{{pf.field.name}}_, message))
return false;
{% endfor %}
{%- for pf in struct.packed.packed_fields if pf.field.kind|is_handle_kind -%}
-if (!DecodeHandle(&{{param_name}}->{{pf.field.name}}_, &message->handles))
+if (!mojo::internal::DecodeHandle(&{{pf.field.name}}_, &message->handles))
return false;
{% endfor %}
{%- endmacro -%}

Powered by Google App Engine
This is Rietveld 408576698