Upstream version 7.36.149.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 "RuntimeEnabledFeatures.h"
8 #include "platform/heap/Handle.h"
9 #include "wtf/PassRefPtr.h"
10 #include "wtf/RefPtr.h"
11 #include "wtf/RefCounted.h"
12
13 namespace WebCore {
14
15 class InternalRuntimeFlags : public RefCountedWillBeGarbageCollected<InternalRuntimeFlags> {
16 public:
17     static PassRefPtrWillBeRawPtr<InternalRuntimeFlags> create()
18     {
19         return adoptRefWillBeNoop(new InternalRuntimeFlags);
20     }
21
22 {#
23     Setting after startup does not work for most runtime flags, but we
24     could add an option to print setters for ones which do:
25     void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::set{{feature.name}}Enabled(isEnabled); }
26     If we do that, we also need to respect Internals::resetToConsistentState.
27 #}
28     {% for feature in features if not feature.custom %}
29     {% filter enable_conditional(feature.condition) %}
30     bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled(); }
31     {% endfilter %}
32     {% endfor %}
33
34     void trace(Visitor*) { }
35
36 private:
37     InternalRuntimeFlags() { }
38 };
39
40 } // namespace WebCore
41
42 #endif // InternalRuntimeFlags_h