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

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

Issue 1531443003: [bindings] Implement an ExperimentEnabled IDL extended attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments. Created 4 years, 12 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
Index: third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
index 110e8e86368557bf0d9baeb3df52de50ff09503d..a08c3acfde1e98b45a7f669ae60c62ebe552442f 100644
--- a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py
@@ -423,18 +423,19 @@ def conditional_if_endif(code, conditional_string):
'#endif // %s\n' % conditional_string)
+def maybe_add_conditional(code, test, conditional):
+ if not test:
+ return code
+ return generate_indented_conditional(code, conditional)
+
# [Exposed]
def exposed_if(code, exposed_test):
- if not exposed_test:
- return code
- return generate_indented_conditional(code, 'executionContext && (%s)' % exposed_test)
+ return maybe_add_conditional(code, exposed_test, 'executionContext && (%s)' % exposed_test)
# [RuntimeEnabled]
def runtime_enabled_if(code, runtime_enabled_function_name):
- if not runtime_enabled_function_name:
- return code
- return generate_indented_conditional(code, '%s()' % runtime_enabled_function_name)
+ return maybe_add_conditional(code, runtime_enabled_function_name, '%s()' % runtime_enabled_function_name)
################################################################################

Powered by Google App Engine
This is Rietveld 408576698