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

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

Issue 426583003: Revert of Enable the WebIDL [Exposed] annotation on an interface's members. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/core/v8/V8WindowShell.cpp ('k') | Source/bindings/scripts/v8_attributes.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 272b611c34fa69196540cdcf73c0a8ab0a1a0b36..96db1d847470209808935713efd4bec0fccf2673 100644
--- a/Source/bindings/scripts/code_generator_v8.py
+++ b/Source/bindings/scripts/code_generator_v8.py
@@ -239,19 +239,9 @@
jinja_env.filters.update({
'blink_capitalize': capitalize,
'conditional': conditional_if_endif,
- 'exposed': exposed_if,
- 'per_context_enabled': per_context_enabled_if,
'runtime_enabled': runtime_enabled_if,
})
return jinja_env
-
-
-def generate_indented_conditional(code, conditional):
- # Indent if statement to level of original code
- indent = re.match(' *', code).group(0)
- return ('%sif (%s) {\n' % (indent, conditional) +
- ' %s\n' % '\n '.join(code.splitlines()) +
- '%s}\n' % indent)
# [Conditional]
@@ -264,25 +254,15 @@
'#endif // %s\n' % conditional_string)
-# [Exposed]
-def exposed_if(code, exposed_test):
- if not exposed_test:
- return code
- return generate_indented_conditional(code, 'context && (%s)' % exposed_test)
-
-
-# [PerContextEnabled]
-def per_context_enabled_if(code, per_context_enabled_function):
- if not per_context_enabled_function:
- return code
- return generate_indented_conditional(code, 'context && context->isDocument() && %s(toDocument(context))' % per_context_enabled_function)
-
-
# [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)
+ # Indent if statement to level of original code
+ indent = re.match(' *', code).group(0)
+ return ('%sif (%s()) {\n' % (indent, runtime_enabled_function_name) +
+ ' %s\n' % '\n '.join(code.splitlines()) +
+ '%s}\n' % indent)
################################################################################
« no previous file with comments | « Source/bindings/core/v8/V8WindowShell.cpp ('k') | Source/bindings/scripts/v8_attributes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698