Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / build / scripts / templates / InternalRuntimeFlags.h.tmpl
1 {% from 'macros.tmpl' import license %}
2 {{license()}}
3
4 #ifndef InternalRuntimeFlags_h
5 #define InternalRuntimeFlags_h
6
7 #include "bindings/core/v8/ScriptWrappable.h"
8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/heap/Handle.h"
10 #include "wtf/PassRefPtr.h"
11 #include "wtf/RefPtr.h"
12 #include "wtf/RefCounted.h"
13
14 namespace blink {
15
16 class InternalRuntimeFlags : public GarbageCollected<InternalRuntimeFlags>, public ScriptWrappable {
17     DEFINE_WRAPPERTYPEINFO();
18 public:
19     static InternalRuntimeFlags* create()
20     {
21         return new InternalRuntimeFlags;
22     }
23
24 {#
25     Setting after startup does not work for most runtime flags, but we
26     could add an option to print setters for ones which do:
27     void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::set{{feature.name}}Enabled(isEnabled); }
28     If we do that, we also need to respect Internals::resetToConsistentState.
29 #}
30     {% for feature in features if not feature.custom %}
31     {% filter enable_conditional(feature.condition) %}
32     bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled(); }
33     {% endfilter %}
34     {% endfor %}
35
36     void trace(Visitor*) { }
37
38 private:
39     InternalRuntimeFlags() { }
40 };
41
42 } // namespace blink
43
44 #endif // InternalRuntimeFlags_h