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

Unified Diff: third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/module.py

Issue 910883002: Update mojo sdk to rev 8af2ccff2eee4bfca1043015abee30482a030b30 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply 9f87aeadbda22441b7d469e596f7bd7d0d73e2a8 (https://codereview.chromium.org/908973002/) Created 5 years, 10 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: third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/module.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/module.py b/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/module.py
index 8a0f56ba55a9b52345db3386a0ce23e287a38668..c2e59a690048b8ccadf093572e4b72503b057e26 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/module.py
+++ b/third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/generate/module.py
@@ -171,10 +171,11 @@ class EnumValue(NamedValue):
class Constant(object):
- def __init__(self, name=None, kind=None, value=None):
+ def __init__(self, name=None, kind=None, value=None, parent_kind=None):
self.name = name
self.kind = kind
self.value = value
+ self.parent_kind = parent_kind
class Field(object):
@@ -464,6 +465,10 @@ def IsStructKind(kind):
return isinstance(kind, Struct)
+def IsUnionKind(kind):
+ return isinstance(kind, Union)
+
+
def IsArrayKind(kind):
return isinstance(kind, Array)
@@ -494,7 +499,7 @@ def IsMapKind(kind):
def IsObjectKind(kind):
return (IsStructKind(kind) or IsArrayKind(kind) or IsStringKind(kind) or
- IsMapKind(kind))
+ IsMapKind(kind) or IsUnionKind(kind))
def IsNonInterfaceHandleKind(kind):
@@ -512,7 +517,8 @@ def IsAnyHandleKind(kind):
def IsMoveOnlyKind(kind):
- return IsObjectKind(kind) or IsAnyHandleKind(kind)
+ return (not IsStringKind(kind) and IsObjectKind(kind)) or \
+ IsAnyHandleKind(kind)
def IsCloneableKind(kind):
@@ -525,7 +531,7 @@ def IsCloneableKind(kind):
return True
if IsArrayKind(kind):
return ContainsHandles(kind.kind, visited_kinds)
- if IsStructKind(kind):
+ if IsStructKind(kind) or IsUnionKind(kind):
for field in kind.fields:
if ContainsHandles(field.kind, visited_kinds):
return True

Powered by Google App Engine
This is Rietveld 408576698