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

Unified Diff: bindings/scripts/idl_reader.py

Issue 959933002: Move IDLs to 39 roll (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: 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
« no previous file with comments | « bindings/scripts/idl_definitions.py ('k') | bindings/scripts/idl_types.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bindings/scripts/idl_reader.py
diff --git a/bindings/scripts/idl_reader.py b/bindings/scripts/idl_reader.py
index 23797a79dd93d1448675af06dec8a74a2eb986c1..7c7f5e57dde00be9706fd3dc45818819323c9cde 100644
--- a/bindings/scripts/idl_reader.py
+++ b/bindings/scripts/idl_reader.py
@@ -39,12 +39,14 @@ from blink_idl_parser import BlinkIDLParser
from idl_definitions import IdlDefinitions
from idl_validator import EXTENDED_ATTRIBUTES_RELATIVE_PATH, IDLInvalidExtendedAttributeError, IDLExtendedAttributeValidator
from interface_dependency_resolver import InterfaceDependencyResolver
+from utilities import idl_filename_to_component
class IdlReader(object):
def __init__(self, interfaces_info=None, outputdir='', multi_interface=False):
self.multi_interface = multi_interface
self.extended_attribute_validator = IDLExtendedAttributeValidator()
+ self.interfaces_info = interfaces_info
if interfaces_info:
self.interface_dependency_resolver = InterfaceDependencyResolver(interfaces_info, self)
@@ -54,12 +56,19 @@ class IdlReader(object):
self.parser = BlinkIDLParser(outputdir=outputdir)
def read_idl_definitions(self, idl_filename):
- """Returns an IdlDefinitions object for an IDL file, including all dependencies."""
+ """Returns a dictionary whose key is component and value is an IdlDefinitions object for an IDL file, including all dependencies."""
definitions = self.read_idl_file(idl_filename)
+ component = idl_filename_to_component(idl_filename)
+
if not self.interface_dependency_resolver:
- return definitions
- self.interface_dependency_resolver.resolve_dependencies(definitions)
- return definitions
+ return {component: definitions}
+
+ # This definitions should have a dictionary. No need to resolve any
+ # dependencies.
+ if not definitions.interfaces:
+ return {component: definitions}
+
+ return self.interface_dependency_resolver.resolve_dependencies(definitions, component)
def read_idl_file(self, idl_filename):
"""Returns an IdlDefinitions object for an IDL file, without any dependencies.
« no previous file with comments | « bindings/scripts/idl_definitions.py ('k') | bindings/scripts/idl_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698