Upstream version 9.38.198.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 RefCountedWillBeGarbageCollected<InternalRuntimeFlags>, public ScriptWrappable {
17 public:
18     static PassRefPtrWillBeRawPtr<InternalRuntimeFlags> create()
19     {
20         return adoptRefWillBeNoop(new InternalRuntimeFlags);
21     }
22
23 {#
24     Setting after startup does not work for most runtime flags, but we
25     could add an option to print setters for ones which do:
26     void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::set{{feature.name}}Enabled(isEnabled); }
27     If we do that, we also need to respect Internals::resetToConsistentState.
28 #}
29     {% for feature in features if not feature.custom %}
30     {% filter enable_conditional(feature.condition) %}
31     bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled(); }
32     {% endfilter %}
33     {% endfor %}
34
35     void trace(Visitor*) { }
36
37 private:
38     InternalRuntimeFlags()
39     {
40         ScriptWrappable::init(this);
41     }
42 };
43
44 } // namespace blink
45
46 #endif // InternalRuntimeFlags_h