Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / build / scripts / templates / InternalRuntimeFlags.h.tmpl
blobbef1779558a13705850edb62e22c9d977fe7041f
1 {% from 'macros.tmpl' import license %}
2 {{license()}}
4 #ifndef InternalRuntimeFlags_h
5 #define InternalRuntimeFlags_h
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"
14 namespace blink {
16 class InternalRuntimeFlags : public GarbageCollected<InternalRuntimeFlags>, public ScriptWrappable {
17     DEFINE_WRAPPERTYPEINFO();
18 public:
19     static InternalRuntimeFlags* create()
20     {
21         return new InternalRuntimeFlags;
22     }
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.
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 %}
36     DEFINE_INLINE_TRACE() { }
38 private:
39     InternalRuntimeFlags() { }
42 } // namespace blink
44 #endif // InternalRuntimeFlags_h