| OLD | NEW |
| 1 {% from "macros.tmpl" import wrap_with_condition, license -%} | 1 {% from "macros.tmpl" import wrap_with_condition, license %} |
| 2 {{ license() }} | 2 {{ license() }} |
| 3 | 3 |
| 4 #ifndef InternalRuntimeFlags_h | 4 #ifndef InternalRuntimeFlags_h |
| 5 #define InternalRuntimeFlags_h | 5 #define InternalRuntimeFlags_h |
| 6 | 6 |
| 7 #include "RuntimeEnabledFeatures.h" | 7 #include "RuntimeEnabledFeatures.h" |
| 8 #include "heap/Handle.h" | 8 #include "heap/Handle.h" |
| 9 #include "wtf/PassRefPtr.h" | 9 #include "wtf/PassRefPtr.h" |
| 10 #include "wtf/RefPtr.h" | 10 #include "wtf/RefPtr.h" |
| 11 #include "wtf/RefCounted.h" | 11 #include "wtf/RefCounted.h" |
| 12 | 12 |
| 13 namespace WebCore { | 13 namespace WebCore { |
| 14 | 14 |
| 15 class InternalRuntimeFlags : public RefCountedWillBeGarbageCollected<InternalRun
timeFlags> { | 15 class InternalRuntimeFlags : public RefCountedWillBeGarbageCollected<InternalRun
timeFlags> { |
| 16 public: | 16 public: |
| 17 static PassRefPtrWillBeRawPtr<InternalRuntimeFlags> create() | 17 static PassRefPtrWillBeRawPtr<InternalRuntimeFlags> create() |
| 18 { | 18 { |
| 19 return adoptRefWillBeNoop(new InternalRuntimeFlags); | 19 return adoptRefWillBeNoop(new InternalRuntimeFlags); |
| 20 } | 20 } |
| 21 | 21 |
| 22 {#- | 22 {# |
| 23 Setting after startup does not work for most runtime flags, but we | 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: | 24 could add an option to print setters for ones which do: |
| 25 void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::se
t{{feature.name}}Enabled(isEnabled); } | 25 void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::se
t{{feature.name}}Enabled(isEnabled); } |
| 26 If we do that, we also need to respect Internals::resetToConsistentState. | 26 If we do that, we also need to respect Internals::resetToConsistentState. |
| 27 #} | 27 #} |
| 28 {% for feature in features if not feature.custom %} | 28 {% for feature in features if not feature.custom %} |
| 29 {%- call wrap_with_condition(feature.condition) %} | 29 {% call wrap_with_condition(feature.condition) %} |
| 30 bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures
::{{feature.first_lowered_name}}Enabled(); } | 30 bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures
::{{feature.first_lowered_name}}Enabled(); } |
| 31 {%- endcall %} | 31 {% endcall %} |
| 32 {% endfor %} | 32 {# FIXME: remove extra blank line #} |
| 33 |
| 34 {% endfor %} |
| 33 | 35 |
| 34 void trace(Visitor*) { } | 36 void trace(Visitor*) { } |
| 35 | 37 |
| 36 private: | 38 private: |
| 37 InternalRuntimeFlags() { } | 39 InternalRuntimeFlags() { } |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 } // namespace WebCore | 42 } // namespace WebCore |
| 41 | 43 |
| 42 #endif // InternalRuntimeFlags_h | 44 #endif // InternalRuntimeFlags_h |
| OLD | NEW |