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

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

Issue 272323003: Mojo: Implement support for |Foo&| mojom syntax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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/data.py
diff --git a/mojo/public/tools/bindings/pylib/mojom/generate/data.py b/mojo/public/tools/bindings/pylib/mojom/generate/data.py
index 862371af7981471a89de18abdcc570ea5d3b5c6b..000379ff23b4072fe37a3c21fe5013be392ac77f 100644
--- a/mojo/public/tools/bindings/pylib/mojom/generate/data.py
+++ b/mojo/public/tools/bindings/pylib/mojom/generate/data.py
@@ -87,6 +87,9 @@ def KindFromData(kinds, data, scope):
if data.startswith('a:'):
kind = mojom.Array()
kind.kind = KindFromData(kinds, data[2:], scope)
+ elif data.startswith('r:'):
+ kind = mojom.InterfaceRequest()
+ kind.kind = KindFromData(kinds, data[2:], scope)
else:
kind = mojom.Kind()
kind.spec = data
@@ -94,8 +97,8 @@ def KindFromData(kinds, data, scope):
return kind
def KindFromImport(original_kind, imported_from):
- """Used with 'import module' - clones the kind imported from the
- given module's namespace. Only used with Structs and Enums."""
+ """Used with 'import module' - clones the kind imported from the given
+ module's namespace. Only used with Structs, Interfaces and Enums."""
kind = copy.deepcopy(original_kind)
kind.imported_from = imported_from
return kind
@@ -110,7 +113,7 @@ def ImportFromData(module, data):
# Copy the struct kinds from our imports into the current module.
for kind in import_module.kinds.itervalues():
- if (isinstance(kind, (mojom.Struct, mojom.Enum)) and
+ if (isinstance(kind, (mojom.Struct, mojom.Enum, mojom.Interface)) and
kind.imported_from is None):
kind = KindFromImport(kind, import_item)
module.kinds[kind.spec] = kind

Powered by Google App Engine
This is Rietveld 408576698