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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl

Issue 917433003: Update mojo sdk to rev 1027d24a1f68c6d10b7539b32114f1272b2cc9f1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add //build/module_args/mojo.gni. Created 5 years, 10 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: third_party/mojo/src/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl b/third_party/mojo/src/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
index 62b497cb2622f3a0494a27f710a95e79aeec5a19..8a02ee427d9c0f47fa4d6769b1f3b5d99ba2655e 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
@@ -38,7 +38,7 @@
if (err !== validator.validationError.NONE)
return err;
{%- endmacro %}
- err = messageValidator.validateStructHeader(offset, {{struct.name}}.encodedSize, {{struct.packed.packed_fields|length}});
+ err = messageValidator.validateStructHeader(offset, {{struct.name}}.encodedSize, {{struct.versions[-1].version}});
{{check_err()}}
{%- for packed_field in struct.packed.packed_fields %}
@@ -77,7 +77,7 @@
var packed;
var val = new {{struct.name}}();
var numberOfBytes = decoder.readUint32();
- var numberOfFields = decoder.readUint32();
+ var version = decoder.readUint32();
{%- for byte in struct.bytes %}
{%- if byte.packed_fields|length > 1 %}
packed = decoder.readUint8();
@@ -99,7 +99,7 @@
{{struct.name}}.encode = function(encoder, val) {
var packed;
encoder.writeUint32({{struct.name}}.encodedSize);
- encoder.writeUint32({{struct.packed.packed_fields|length}});
+ encoder.writeUint32({{struct.versions[-1].version}});
{%- for byte in struct.bytes %}
{%- if byte.packed_fields|length > 1 %}

Powered by Google App Engine
This is Rietveld 408576698