Index: mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl |
diff --git a/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl b/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl |
index 69da1aad4dbb8dd06040b7af20a8e18e42595ff8..1f64e6967c23eced1bc33c1483a0f518bcc11bf8 100644 |
--- a/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl |
+++ b/mojo/public/tools/bindings/generators/dart_templates/struct_definition.tmpl |
@@ -26,6 +26,12 @@ class {{struct|name}} extends bindings.Struct { |
{{struct|name}}() : super(kVersions.last.size); |
+ {{struct|name}}.init( |
+{%- for packed_field in struct.packed.packed_fields %} |
+ {{packed_field.field.kind|dart_type}} this.{{packed_field.field|name}}{% if not loop.last %}, {% endif %} |
+{%- endfor %} |
+ ) : super(kVersions.last.size); |
+ |
static {{struct|name}} deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |