Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import 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 "bindings/core/v8/ScriptWrappable.h" | 7 #include "bindings/core/v8/ScriptWrappable.h" |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/PassRefPtr.h" | 10 #include "wtf/PassRefPtr.h" |
| 11 #include "wtf/RefPtr.h" | 11 #include "wtf/RefPtr.h" |
| 12 #include "wtf/RefCounted.h" | 12 #include "wtf/RefCounted.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class InternalRuntimeFlags : public GarbageCollected<InternalRuntimeFlags>, publ ic ScriptWrappable { | 16 class InternalRuntimeFlags : public GarbageCollected<InternalRuntimeFlags>, publ ic ScriptWrappable { |
| 17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
| 18 public: | 18 public: |
| 19 static InternalRuntimeFlags* create() | 19 static InternalRuntimeFlags* create(); |
| 20 { | |
| 21 return new InternalRuntimeFlags; | |
| 22 } | |
| 23 | 20 |
| 24 {# | |
| 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::se t{{feature.name}}Enabled(isEnabled); } | |
| 28 If we do that, we also need to respect Internals::resetToConsistentState. | |
| 29 #} | |
| 30 {% for feature in standard_features %} | 21 {% for feature in standard_features %} |
| 31 bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures ::{{feature.first_lowered_name}}Enabled(); } | 22 {% if feature.set_from_internals %} |
|
wkorman
2016/04/26 19:01:18
Rather than looping and checking feature.set_from_
ymalik
2016/04/26 20:17:39
I think that would only be the case if we plan to
| |
| 23 void set{{feature.name}}Enabled(bool isEnabled); | |
| 24 {% endif %} | |
| 25 {% endfor %} | |
| 26 | |
| 27 {% for feature in standard_features %} | |
| 28 bool {{feature.first_lowered_name}}Enabled(); | |
| 32 {% endfor %} | 29 {% endfor %} |
| 33 | 30 |
| 34 DEFINE_INLINE_TRACE() { } | 31 DEFINE_INLINE_TRACE() { } |
| 35 | 32 |
| 36 private: | 33 private: |
| 37 InternalRuntimeFlags() { } | 34 InternalRuntimeFlags(); |
| 35 | |
| 36 {% for feature in standard_features %} | |
| 37 bool m_{{feature.first_lowered_name}}; | |
| 38 {% endfor %} | |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 } // namespace blink | 41 } // namespace blink |
| 41 | 42 |
| 42 #endif // InternalRuntimeFlags_h | 43 #endif // InternalRuntimeFlags_h |
| OLD | NEW |