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

Side by Side Diff: Source/core/page/RuntimeEnabledFeatures.h.tmpl

Issue 14905002: Use jinja2 templating engine for Python code generators (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 {% from "macros.tmpl" import wrap_with_condition -%}
2
3 {{ license }}
4 #ifndef RuntimeEnabledFeatures_h
5 #define RuntimeEnabledFeatures_h
6
7 namespace WebCore {
8
9 // A class that stores static enablers for all experimental features.
10
11 class RuntimeEnabledFeatures {
12 public:
13 {%- for feature in features %}
14 {%- if feature.custom %}
15 static bool {{feature.first_lowered_name}}Enabled();
16 {%- else %}
17 {%- if feature.condition %}
18 #if ENABLE({{feature.condition}})
19 {%- endif %}
20 static void set{{feature.name}}Enabled(bool isEnabled) { is{{feature.name}}E nabled = isEnabled; }
21 static bool {{feature.first_lowered_name}}Enabled() { return {{feature.enabl ed_condition}}; }
22 {%- if feature.condition %}
23 #else
24 static void set{{feature.name}}Enabled(bool) { }
25 static bool {{feature.first_lowered_name}}Enabled() { return false; }
26 #endif
27 {%- endif %}
28 {%- endif %}
29 {% endfor %}
30
31 private:
32 RuntimeEnabledFeatures() { }
33
34 {% for feature in features if not feature.custom %}
35 {%- call wrap_with_condition(feature.condition) %}
36 static bool is{{feature.name}}Enabled;
37 {%- endcall %}
38 {%- endfor %}
39 };
40
41 } // namespace WebCore
42
43 #endif // RuntimeEnabledFeatures_h
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698