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

Unified Diff: Source/bindings/scripts/compute_interfaces_info_individual.py

Issue 831483004: IDL: Make enums have global visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « Source/bindings/scripts/code_generator_v8.py ('k') | Source/bindings/scripts/utilities.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/compute_interfaces_info_individual.py
diff --git a/Source/bindings/scripts/compute_interfaces_info_individual.py b/Source/bindings/scripts/compute_interfaces_info_individual.py
index 9876b028a180389f04f3e2d1a90aa096d0bd333e..8f10a4a5f2c6c82bf67c05ed0d71282de5a0f7a5 100755
--- a/Source/bindings/scripts/compute_interfaces_info_individual.py
+++ b/Source/bindings/scripts/compute_interfaces_info_individual.py
@@ -168,6 +168,7 @@ class InterfaceInfoCollector(object):
'full_paths': [],
'include_paths': [],
})
+ self.enumerations = set()
self.union_types = set()
self.typedefs = {}
@@ -207,8 +208,13 @@ class InterfaceInfoCollector(object):
this_union_types = collect_union_types_from_definitions(definitions)
self.union_types.update(this_union_types)
-
self.typedefs.update(definitions.typedefs)
+ # Check enum duplication.
+ for enum_name in definitions.enumerations.keys():
+ for defined_enum in self.enumerations:
+ if defined_enum.name == enum_name:
+ raise Exception('Enumeration %s has multiple definitions' % enum_name)
+ self.enumerations.update(definitions.enumerations.values())
extended_attributes = definition.extended_attributes
implemented_as = extended_attributes.get('ImplementedAs')
@@ -262,6 +268,8 @@ class InterfaceInfoCollector(object):
def get_component_info_as_dict(self):
"""Returns component wide information as a dict."""
return {
+ 'enumerations': dict((enum.name, enum.values)
+ for enum in self.enumerations),
'typedefs': self.typedefs,
'union_types': self.union_types,
}
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.py ('k') | Source/bindings/scripts/utilities.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698