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

Unified Diff: tools/json_schema_compiler/idl_schema.py

Issue 38573008: Add "platforms" key in IDL schema compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment issues Created 7 years, 2 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 | « no previous file | tools/json_schema_compiler/idl_schema_test.py » ('j') | tools/json_schema_compiler/model.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/idl_schema.py
diff --git a/tools/json_schema_compiler/idl_schema.py b/tools/json_schema_compiler/idl_schema.py
index 44a4a55eaec8e06523919a621c9e450aeaa6637e..2e7d418f25f7c46fd22325c6b91587ecbd62c43e 100644
--- a/tools/json_schema_compiler/idl_schema.py
+++ b/tools/json_schema_compiler/idl_schema.py
@@ -313,10 +313,12 @@ class Namespace(object):
dictionary that the JSON schema compiler expects to see.
'''
- def __init__(self, namespace_node, description, nodoc=False, internal=False):
+ def __init__(self, namespace_node, description, nodoc=False, internal=False,
+ platforms=None):
not at google - send to devlin 2013/10/28 17:04:48 bad news; now these need to all be on different li
Haojian Wu 2013/10/29 02:09:32 Done.
self.namespace = namespace_node
self.nodoc = nodoc
self.internal = internal
+ self.platforms = platforms
self.events = []
self.functions = []
self.types = []
@@ -344,7 +346,8 @@ class Namespace(object):
'types': self.types,
'functions': self.functions,
'internal': self.internal,
- 'events': self.events}
+ 'events': self.events,
+ 'platforms': self.platforms}
def process_interface(self, node):
members = []
@@ -369,6 +372,7 @@ class IDLSchema(object):
nodoc = False
internal = False
description = None
+ platforms = None
for node in self.idl:
if node.cls == 'Namespace':
if not description:
@@ -376,10 +380,11 @@ class IDLSchema(object):
print('%s must have a namespace-level comment. This will '
'appear on the API summary page.' % node.GetName())
description = ''
- namespace = Namespace(node, description, nodoc, internal)
+ namespace = Namespace(node, description, nodoc, internal, platforms)
namespaces.append(namespace.process())
nodoc = False
internal = False
+ platforms = None
elif node.cls == 'Copyright':
continue
elif node.cls == 'Comment':
@@ -389,6 +394,8 @@ class IDLSchema(object):
nodoc = bool(node.value)
elif node.name == 'internal':
internal = bool(node.value)
+ elif node.name == 'platforms':
+ platforms = list(node.value)
else:
continue
else:
« no previous file with comments | « no previous file | tools/json_schema_compiler/idl_schema_test.py » ('j') | tools/json_schema_compiler/model.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698