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

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

Issue 2112313002: Dart: Fixes enum array encoding (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 6 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/tools/bindings/generators/dart_templates/encoding_macros.tmpl ('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_dart_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_dart_generator.py b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
index 849e6afa7f5f792aea72da83243f041c097765dc..3aceb135a7a28ce93362c43d0d2a86e5cf167229 100644
--- a/mojo/public/tools/bindings/generators/mojom_dart_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
@@ -319,26 +319,26 @@ def GetDartTrueFalse(value):
return 'true' if value else 'false'
def GetArrayNullabilityFlags(kind):
- """Returns nullability flags for an array type, see codec.dart.
-
- As we have dedicated decoding functions for arrays, we have to pass
- nullability information about both the array itself, as well as the array
- element type there.
- """
- assert mojom.IsArrayKind(kind)
- ARRAY_NULLABLE = 'bindings.kArrayNullable'
- ELEMENT_NULLABLE = 'bindings.kElementNullable'
- NOTHING_NULLABLE = 'bindings.kNothingNullable'
-
- flags_to_set = []
- if mojom.IsNullableKind(kind):
- flags_to_set.append(ARRAY_NULLABLE)
- if mojom.IsNullableKind(kind.kind):
- flags_to_set.append(ELEMENT_NULLABLE)
-
- if not flags_to_set:
- flags_to_set = [NOTHING_NULLABLE]
- return ' | '.join(flags_to_set)
+ """Returns nullability flags for an array type, see codec.dart.
+
+ As we have dedicated decoding functions for arrays, we have to pass
+ nullability information about both the array itself, as well as the array
+ element type there.
+ """
+ assert mojom.IsArrayKind(kind)
+ ARRAY_NULLABLE = 'bindings.kArrayNullable'
+ ELEMENT_NULLABLE = 'bindings.kElementNullable'
+ NOTHING_NULLABLE = 'bindings.kNothingNullable'
+
+ flags_to_set = []
+ if mojom.IsNullableKind(kind):
+ flags_to_set.append(ARRAY_NULLABLE)
+ if mojom.IsNullableKind(kind.kind):
+ flags_to_set.append(ELEMENT_NULLABLE)
+
+ if not flags_to_set:
+ flags_to_set = [NOTHING_NULLABLE]
+ return ' | '.join(flags_to_set)
def AppendDecodeParams(initial_params, kind, bit):
""" Appends standard parameters for decode calls. """
« no previous file with comments | « mojo/public/tools/bindings/generators/dart_templates/encoding_macros.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698