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

Unified Diff: mojo/public/tools/bindings/generators/mojom_js_generator.py

Issue 460063002: Refactor JavaScript support for packed boolean arrays (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 6 years, 4 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
« no previous file with comments | « mojo/public/js/bindings/codec.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/mojom_js_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py
index 3e2f1c888ac97d4c0c45e2bd50f4d94be36a4258..5b83974d97943ec15a117e877cd978bef32a1c73 100644
--- a/mojo/public/tools/bindings/generators/mojom_js_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py
@@ -98,7 +98,7 @@ def CodecType(kind):
if mojom.IsStructKind(kind):
return "new codec.PointerTo(%s)" % CodecType(kind.name)
if mojom.IsArrayKind(kind) and mojom.IsBoolKind(kind.kind):
- return "new codec.ArrayOfBoolArrayPointers()"
+ return "new codec.ArrayOf(new codec.ArrayOf(codec.PackedBool))"
if mojom.IsArrayKind(kind):
return "new codec.ArrayOf(%s)" % CodecType(kind.kind)
if mojom.IsInterfaceKind(kind) or mojom.IsInterfaceRequestKind(kind):
@@ -114,7 +114,7 @@ def JavaScriptDecodeSnippet(kind):
if mojom.IsStructKind(kind):
return "decodeStructPointer(%s)" % CodecType(kind.name)
if mojom.IsArrayKind(kind) and mojom.IsBoolKind(kind.kind):
- return "decodeBoolArrayPointer()"
+ return "decodeArrayPointer(new codec.ArrayOf(codec.PackedBool))"
if mojom.IsArrayKind(kind):
return "decodeArrayPointer(%s)" % CodecType(kind.kind)
if mojom.IsInterfaceKind(kind) or mojom.IsInterfaceRequestKind(kind):
@@ -129,7 +129,7 @@ def JavaScriptEncodeSnippet(kind):
if mojom.IsStructKind(kind):
return "encodeStructPointer(%s, " % CodecType(kind.name)
if mojom.IsArrayKind(kind) and mojom.IsBoolKind(kind.kind):
- return "encodeBoolArrayPointer(";
+ return "encodeArrayPointer(new codec.ArrayOf(codec.PackedBool), ";
if mojom.IsAnyArrayKind(kind):
return "encodeArrayPointer(%s, " % CodecType(kind.kind)
if mojom.IsInterfaceKind(kind) or mojom.IsInterfaceRequestKind(kind):
« no previous file with comments | « mojo/public/js/bindings/codec.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698