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

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

Issue 1524703002: [mojo] Support native types with mojom wire format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindings-5-pickles
Patch Set: doc 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_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 5c14ea0da15179a91b67489f27c199c960cf6626..555750180d52ac4cee1949d067d33929e8aad09e 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
@@ -29,3 +29,22 @@ bool Deserialize_(internal::{{struct.name}}_Data* input,
}
return success;
}
+
+{%- if not variant %}
+
+{{struct.name}}_Reader::{{struct.name}}_Reader(
+ internal::{{struct.name}}_Data* data,
+ mojo::internal::SerializationContext* context)
+ : data_(data), context_(context) { }
+
+{%- for pf in struct.packed.packed_fields_in_ordinal_order %}
+{%- set name = pf.field.name -%}
+{%- set kind = pf.field.kind -%}
+{%- if kind|is_struct_kind %}
+{{kind|get_name_for_kind}}_Reader {{struct.name}}_Reader::{{name}}() const {
+ return {{kind|get_name_for_kind}}_Reader(data_->{{name}}.ptr, context_);
+}
+{%- endif %}
+{%- endfor %}
+
+{%- endif %}

Powered by Google App Engine
This is Rietveld 408576698