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

Unified Diff: third_party/WebKit/Source/bindings/scripts/code_generator.py

Issue 2578943002: [Bindings] Refactoring of binding code around runtime enabled features (Closed)
Patch Set: Work for a comment Created 4 years 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 | third_party/WebKit/Source/bindings/scripts/v8_attributes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/scripts/code_generator.py
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator.py b/third_party/WebKit/Source/bindings/scripts/code_generator.py
index 20f784f16c06caef867f7c5b1a39de04b5afb781..cc69d997c107d8cf4ddd596cdc64ac34010370ba 100644
--- a/third_party/WebKit/Source/bindings/scripts/code_generator.py
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator.py
@@ -16,6 +16,7 @@ from v8_globals import includes
from v8_interface import constant_filters
from v8_types import set_component_dirs
from v8_methods import method_filters
+import v8_utilities
from v8_utilities import capitalize, unique_by
from utilities import (idl_filename_to_component, is_valid_component_dependency,
format_remove_duplicates, format_blink_cpp_source_code)
@@ -64,10 +65,12 @@ def secure_context_if(code, secure_context_test):
# [RuntimeEnabled]
-def runtime_enabled_if(code, runtime_enabled_function_name):
- if not runtime_enabled_function_name:
+def runtime_enabled_if(code, name):
+ if not name:
return code
- return generate_indented_conditional(code, '%s()' % runtime_enabled_function_name)
+
+ function = 'RuntimeEnabledFeatures::%sEnabled()' % v8_utilities.uncapitalize(name)
+ return generate_indented_conditional(code, function)
def initialize_jinja_env(cache_dir):
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/scripts/v8_attributes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698