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

Unified Diff: Source/bindings/scripts/code_generator_v8.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 | « no previous file | Source/bindings/scripts/compute_interfaces_info_individual.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/code_generator_v8.py
diff --git a/Source/bindings/scripts/code_generator_v8.py b/Source/bindings/scripts/code_generator_v8.py
index e9d6e0b5c5a128a2d9c201ebf9736b0cc2e585d5..ece96e5b71df83dc7d02aec0188ec04caa7d09d8 100644
--- a/Source/bindings/scripts/code_generator_v8.py
+++ b/Source/bindings/scripts/code_generator_v8.py
@@ -103,10 +103,12 @@ def render_template(include_paths, header_template, cpp_template,
return header_text, cpp_text
-def set_global_type_info(interfaces_info):
+def set_global_type_info(info_provider):
+ interfaces_info = info_provider.interfaces_info
idl_types.set_ancestors(interfaces_info['ancestors'])
IdlType.set_callback_interfaces(interfaces_info['callback_interfaces'])
IdlType.set_dictionaries(interfaces_info['dictionaries'])
+ IdlType.set_enums(info_provider.enumerations)
IdlType.set_implemented_as_interfaces(interfaces_info['implemented_as_interfaces'])
IdlType.set_garbage_collected_types(interfaces_info['garbage_collected_interfaces'])
IdlType.set_will_be_garbage_collected_types(interfaces_info['will_be_garbage_collected_interfaces'])
@@ -120,14 +122,12 @@ class CodeGeneratorBase(object):
self.info_provider = info_provider
self.jinja_env = initialize_jinja_env(cache_dir)
self.output_dir = output_dir
- set_global_type_info(info_provider.interfaces_info)
+ set_global_type_info(info_provider)
def generate_code(self, definitions, definition_name):
"""Returns .h/.cpp code as ((path, content)...)."""
# Set local type info
IdlType.set_callback_functions(definitions.callback_functions.keys())
- IdlType.set_enums((enum.name, enum.values)
- for enum in definitions.enumerations.values())
# Resolve typedefs
definitions.resolve_typedefs(self.info_provider.component_info['typedefs'])
return self.generate_code_internal(definitions, definition_name)
@@ -273,7 +273,7 @@ class CodeGeneratorUnionType(object):
self.jinja_env = initialize_jinja_env(cache_dir)
self.output_dir = output_dir
self.target_component = target_component
- set_global_type_info(info_provider.interfaces_info)
+ set_global_type_info(info_provider)
def generate_code(self):
union_types = self.info_provider.union_types
« no previous file with comments | « no previous file | Source/bindings/scripts/compute_interfaces_info_individual.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698