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

Unified Diff: mojo/public/python/mojo/bindings/descriptor.py

Issue 657783003: mojo: Fix map of booleans for python bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/python/mojo/bindings/descriptor.py
diff --git a/mojo/public/python/mojo/bindings/descriptor.py b/mojo/public/python/mojo/bindings/descriptor.py
index 0c97c06e8370ae91679b38e10969e17d38b7434d..44c0f395432f273298aebc50c8740be6fb8880a6 100644
--- a/mojo/public/python/mojo/bindings/descriptor.py
+++ b/mojo/public/python/mojo/bindings/descriptor.py
@@ -416,8 +416,8 @@ class MapType(SerializableType):
'__module__': __name__,
'DESCRIPTOR': {
'fields': [
- SingleFieldGroup('keys', GenericArrayType(key_type), 0, 0),
- SingleFieldGroup('values', GenericArrayType(value_type), 1, 1),
+ SingleFieldGroup('keys', MapType._GetArrayType(key_type), 0, 0),
+ SingleFieldGroup('values', MapType._GetArrayType(value_type), 1, 1),
],
}
}
@@ -452,6 +452,13 @@ class MapType(SerializableType):
return dict(zip(s.keys, s.values))
return None
+ @staticmethod
+ def _GetArrayType(t):
+ if t == TYPE_BOOL:
+ return BooleanArrayType()
+ else:
+ return GenericArrayType(t)
+
class NoneType(SerializableType):
"""Placeholder type, used temporarily until all mojo types are handled."""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698