| 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 DECLARE_GC_INFO; | |
| 17 public: | 16 public: |
| 18 static PassRefPtrWillBeRawPtr<InternalRuntimeFlags> create() | 17 static PassRefPtrWillBeRawPtr<InternalRuntimeFlags> create() |
| 19 { | 18 { |
| 20 return adoptRefWillBeNoop(new InternalRuntimeFlags); | 19 return adoptRefWillBeNoop(new InternalRuntimeFlags); |
| 21 } | 20 } |
| 22 | 21 |
| 23 {#- | 22 {#- |
| 24 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 |
| 25 could add an option to print setters for ones which do: | 24 could add an option to print setters for ones which do: |
| 26 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); } |
| 27 If we do that, we also need to respect Internals::resetToConsistentState. | 26 If we do that, we also need to respect Internals::resetToConsistentState. |
| 28 #} | 27 #} |
| 29 {% for feature in features if not feature.custom %} | 28 {% for feature in features if not feature.custom %} |
| 30 {%- call wrap_with_condition(feature.condition) %} | 29 {%- call wrap_with_condition(feature.condition) %} |
| 31 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(); } |
| 32 {%- endcall %} | 31 {%- endcall %} |
| 33 {% endfor %} | 32 {% endfor %} |
| 34 | 33 |
| 35 void trace(Visitor*) { } | 34 void trace(Visitor*) { } |
| 36 | 35 |
| 37 private: | 36 private: |
| 38 InternalRuntimeFlags() { } | 37 InternalRuntimeFlags() { } |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 } // namespace WebCore | 40 } // namespace WebCore |
| 42 | 41 |
| 43 #endif // InternalRuntimeFlags_h | 42 #endif // InternalRuntimeFlags_h |
| OLD | NEW |