Index: Source/core/scripts/templates/InternalRuntimeFlags.h.tmpl |
diff --git a/Source/core/scripts/templates/InternalRuntimeFlags.h.tmpl b/Source/core/scripts/templates/InternalRuntimeFlags.h.tmpl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9f7466a76faa8fe7bf724716f974b5edb0d9eda3 |
--- /dev/null |
+++ b/Source/core/scripts/templates/InternalRuntimeFlags.h.tmpl |
@@ -0,0 +1,40 @@ |
+{% from "macros.tmpl" import wrap_with_condition -%} |
+ |
+{{ license }} |
abarth-chromium
2013/05/10 16:18:40
We should probably just make this a subtemplate.
|
+#ifndef InternalRuntimeFlags_h |
+#define InternalRuntimeFlags_h |
+ |
+#include "RuntimeEnabledFeatures.h" |
+#include "wtf/PassRefPtr.h" |
+#include "wtf/RefPtr.h" |
+#include "wtf/RefCounted.h" |
+ |
+namespace WebCore { |
+ |
+class InternalRuntimeFlags : public RefCounted<InternalRuntimeFlags> { |
+public: |
+ static PassRefPtr<InternalRuntimeFlags> create() |
+ { |
+ return adoptRef(new InternalRuntimeFlags); |
+ } |
+ |
+{#- |
+ Setting after startup does not work for most runtime flags, but we |
+ could add an option to print setters for ones which do: |
+ void set{{feature.name}}Enabled(bool isEnabled) { RuntimeEnabledFeatures::set{{feature.name}}Enabled(isEnabled); } |
+ If we do that, we also need to respect Internals::resetToConsistentState. |
+#} |
+{% for feature in features if not feature.custom %} |
+{%- call wrap_with_condition(feature.condition) %} |
+ bool {{feature.first_lowered_name}}Enabled() { return RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled(); } |
+{%- endcall %} |
+{% endfor %} |
+ |
+private: |
+ InternalRuntimeFlags() { } |
+}; |
+ |
+} // namespace WebCore |
+ |
+#endif // InternalRuntimeFlags_h |
+ |