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

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

Issue 923033003: Implement unions as members of structs. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/mojom.gni ('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/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 4e522c97450ac06bf1f9bf1fabe13ac1f03896d3..9c72cfa8d0fbcfb69dc9797e146e85d13b301fa4 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/pack.py
@@ -45,6 +45,8 @@ class PackedField(object):
def GetSizeForKind(cls, kind):
if isinstance(kind, (mojom.Array, mojom.Map, mojom.Struct)):
return 8
+ if isinstance(kind, mojom.Union):
+ return 16
if (isinstance(kind, mojom.Interface) or
isinstance(kind, mojom.InterfaceRequest)):
kind = mojom.MSGPIPE
« no previous file with comments | « mojo/public/tools/bindings/mojom.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698