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

Unified Diff: mojo/public/bindings/parser/mojo_translate.py

Issue 66353002: Mojo: RemotePtr<S> + bindings changes for Peer attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + fix error in sample_service.h Created 7 years, 1 month 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/bindings/lib/remote_ptr.h ('k') | mojo/public/bindings/sample/generated/sample_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/parser/mojo_translate.py
diff --git a/mojo/public/bindings/parser/mojo_translate.py b/mojo/public/bindings/parser/mojo_translate.py
index 00b58a501132b90226fb32898117a7ac3176cacb..472e1ce9aa6e316f589df520b3cf8b5fb7fa2e55 100755
--- a/mojo/public/bindings/parser/mojo_translate.py
+++ b/mojo/public/bindings/parser/mojo_translate.py
@@ -6,6 +6,7 @@
"""Translate parse tree to Mojom IR"""
+import os
import sys
@@ -36,6 +37,14 @@ def MapOrdinal(ordinal):
return int(ordinal[1:]) # Strip leading '@'
+def GetAttribute(attributes, name):
+ out = None
+ for attribute in attributes:
+ if attribute[0] == 'ATTRIBUTE' and attribute[1] == name:
+ out = attribute[2]
+ return out
+
+
def MapFields(fields):
out = []
for field in fields:
@@ -74,16 +83,17 @@ class MojomBuilder():
def AddStruct(self, name, attributes, fields):
struct = {}
struct['name'] = name
+ # TODO(darin): Add support for |attributes|
+ #struct['attributes'] = MapAttributes(attributes)
struct['fields'] = MapFields(fields)
self.mojom['structs'].append(struct)
- # TODO(darin): Add support for |attributes|
def AddInterface(self, name, attributes, methods):
interface = {}
interface['name'] = name
+ interface['peer'] = GetAttribute(attributes, 'Peer')
interface['methods'] = MapMethods(methods)
self.mojom['interfaces'].append(interface)
- # TODO(darin): Add support for |attributes|
def AddModule(self, name, namespace, contents):
self.mojom['name'] = name
« no previous file with comments | « mojo/public/bindings/lib/remote_ptr.h ('k') | mojo/public/bindings/sample/generated/sample_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698