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

Unified Diff: mojo/public/tools/bindings/pylib/mojom/generate/pack.py

Issue 437643002: Support nullable types in mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: mojo/public/tools/bindings/pylib/mojom/generate/pack.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/pack.py b/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
index d6d0152203020395311f6add668f6b4f15171e9d..da216b03cf91b5a694453ab408f80899950658ea 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
@@ -34,6 +34,8 @@ class PackedField(object):
@classmethod
def GetSizeForKind(cls, kind):
+ if isinstance(kind, mojom.Nullable):
+ return cls.GetSizeForKind(kind.kind)
if isinstance(kind, (mojom.Array, mojom.Struct, mojom.FixedArray)):
return 8
if isinstance(kind, mojom.Interface) or \

Powered by Google App Engine
This is Rietveld 408576698