Chromium Code Reviews| Index: third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.cpp.tmpl |
| diff --git a/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.cpp.tmpl |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..31826ec3f59bb144e9825d9203cd4f05a2895123 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.cpp.tmpl |
| @@ -0,0 +1,37 @@ |
| +{% from "macros.tmpl" import license %} |
| +{{ license() }} |
| + |
| +#include "InternalRuntimeFlags.h" |
| + |
| +namespace blink { |
| + |
| +InternalRuntimeFlags* InternalRuntimeFlags::create() |
| +{ |
| + return new InternalRuntimeFlags; |
| +} |
| + |
| +InternalRuntimeFlags::InternalRuntimeFlags() |
| + : m_{{standard_features[0].first_lowered_name}}(RuntimeEnabledFeatures::{{standard_features[0].first_lowered_name}}Enabled()) |
|
wkorman
2016/04/26 19:01:18
Might be better to do this as a straight for-loop
ymalik
2016/04/26 20:17:39
Yeah. We're also doing it that way in the template
|
| + {% for feature in standard_features[1:] %} |
| + , m_{{feature.first_lowered_name}}(RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled()) |
| + {% endfor %} |
| +{ |
| +} |
| + |
| +{% for feature in standard_features %} |
| +{% if feature.set_from_internals %} |
| +void InternalRuntimeFlags::set{{feature.name}}Enabled(bool isEnabled) |
| +{ |
| + RuntimeEnabledFeatures::set{{feature.name}}Enabled(isEnabled); |
| +} |
| +{% endif %} |
| +{% endfor %} |
| + |
| +{% for feature in standard_features %} |
| +bool InternalRuntimeFlags::{{feature.first_lowered_name}}Enabled() |
| +{ |
| + return RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled(); |
| +} |
| +{% endfor %} |
| + |
| +} // namespace blink |