Commit 653db950 authored by grv@chromium.org's avatar grv@chromium.org

Add INTERNAL annotation to namespaces in IDL


BUG=129311
TEST=unittest


Review URL: https://chromiumcodereview.appspot.com/10677015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149553 0039d316-1c4b-4281-b951-d872f2087c98
parent b1409cc1
......@@ -262,9 +262,11 @@ class Namespace(object):
dictionary that the JSON schema compiler expects to see.
'''
def __init__(self, namespace_node, nodoc=False, permissions=None):
def __init__(self, namespace_node, nodoc=False, permissions=None,
internal=False):
self.namespace = namespace_node
self.nodoc = nodoc
self.internal = internal
self.events = []
self.functions = []
self.types = []
......@@ -291,6 +293,7 @@ class Namespace(object):
'documentation_permissions_required': self.permissions,
'types': self.types,
'functions': self.functions,
'internal': self.internal,
'events': self.events}
def process_interface(self, node):
......@@ -313,11 +316,14 @@ class IDLSchema(object):
def process(self):
namespaces = []
nodoc = False
internal = False
permissions = None
for node in self.idl:
if node.cls == 'Namespace':
namespace = Namespace(node, nodoc, permissions)
namespace = Namespace(node, nodoc, permissions, internal)
namespaces.append(namespace.process())
nodoc = False
internal = False
elif node.cls == 'Copyright':
continue
elif node.cls == 'Comment':
......@@ -327,6 +333,8 @@ class IDLSchema(object):
nodoc = bool(node.value)
elif node.name == 'permissions':
permission = node.value.split(',')
elif node.name == 'internal':
internal = bool(node.value)
else:
continue
else:
......
......@@ -84,6 +84,12 @@ class IdlSchemaTest(unittest.TestCase):
self.assertTrue(func is not None)
self.assertTrue(func['nocompile'])
def testInternalNamespace(self):
idl_basics = self.idl_basics
self.assertEquals('idl_basics', idl_basics['namespace'])
self.assertTrue(idl_basics['internal'])
self.assertFalse(idl_basics['nodoc'])
def testFunctionComment(self):
schema = self.idl_basics
func = getFunction(schema, 'function3')
......
......@@ -4,7 +4,7 @@
// Tests a variety of basic API definition features.
namespace idl_basics {
[internal] namespace idl_basics {
// Enum description
enum EnumType {
name1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment