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

Unified Diff: Source/bindings/templates/constants.cpp

Issue 1329653003: [bindings] Club related constants for a runtime enabled flag in a single |if| block (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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/v8_interface.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/constants.cpp
diff --git a/Source/bindings/templates/constants.cpp b/Source/bindings/templates/constants.cpp
index d867b2c8ea3dc982b3f398de6729bc6d75fc9e05..d35639bb71caaf90faaf54f832f9d00ef3b22085 100644
--- a/Source/bindings/templates/constants.cpp
+++ b/Source/bindings/templates/constants.cpp
@@ -35,10 +35,13 @@ static const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] =
V8DOMConfiguration::installConstants(isolate, functionTemplate, prototypeTemplate, {{v8_class}}Constants, WTF_ARRAY_LENGTH({{v8_class}}Constants));
{% endif %}
{# Runtime-enabled constants #}
-{% for constant in runtime_enabled_constants %}
-{% filter runtime_enabled(constant.runtime_enabled_function) %}
-static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {{constant_configuration(constant)}};
-V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constantConfiguration);
+{% for constant_tuple in runtime_enabled_constants %}
+{% filter runtime_enabled(constant_tuple[0]) %}
+{% for constant in constant_tuple[1] %}
+{% set constant_name = constant.name.title().replace('_', '') %}
+static const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configuration = {{constant_configuration(constant)}};
+V8DOMConfiguration::installConstant(isolate, functionTemplate, prototypeTemplate, constant{{constant_name}}Configuration);
+{% endfor %}
{% endfilter %}
{% endfor %}
{# Constants with [DeprecateAs] or [MeasureAs] #}
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698