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

Side by Side Diff: Source/core/scripts/templates/InternalRuntimeFlags.h.tmpl

Issue 15095002: Use jinja2 for make_runtime_features and make_internal_runtime_flags (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Updated for Eric's suggestions 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, license -%}
2 {{ license() }}
3
4 #ifndef InternalRuntimeFlags_h
5 #define InternalRuntimeFlags_h
6
7 #include "RuntimeEnabledFeatures.h"
8 #include "wtf/PassRefPtr.h"
9 #include "wtf/RefPtr.h"
10 #include "wtf/RefCounted.h"
11
12 namespace WebCore {
13
14 class InternalRuntimeFlags : public RefCounted<InternalRuntimeFlags> {
15 public:
16 static PassRefPtr<InternalRuntimeFlags> create()
17 {
18 return adoptRef(new InternalRuntimeFlags);
19 }
20
21 {#-
22 Setting after startup does not work for most runtime flags, but we
23 could add an option to print setters for ones which do:
24 void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::se t{{feature.name}}Enabled(isEnabled); }
25 If we do that, we also need to respect Internals::resetToConsistentState.
26 #}
27 {% for feature in features if not feature.custom %}
28 {%- call wrap_with_condition(feature.condition) %}
29 bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures ::{{feature.first_lowered_name}}Enabled(); }
30 {%- endcall %}
31 {% endfor %}
32
33 private:
34 InternalRuntimeFlags() { }
35 };
36
37 } // namespace WebCore
38
39 #endif // InternalRuntimeFlags_h
40
OLDNEW
« no previous file with comments | « Source/core/scripts/template_expander.py ('k') | Source/core/scripts/templates/InternalRuntimeFlags.idl.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698