Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: third_party/WebKit/Source/build/scripts/templates/ExperimentalFeatures.cpp.tmpl

Issue 1538663003: Add code generation for ExperimentalFeatures class from RuntimeEnabledFeatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken GN build dependency Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/build/scripts/templates/ExperimentalFeatures.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/ExperimentalFeatures.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ExperimentalFeatures.cpp.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..d4edb9d1f3fb2f1cbfc3902998de45ca9d3a909c
--- /dev/null
+++ b/third_party/WebKit/Source/build/scripts/templates/ExperimentalFeatures.cpp.tmpl
@@ -0,0 +1,23 @@
+{% from 'macros.tmpl' import license %}
+{{license()}}
+
+#include "config.h"
+#include "core/experiments/ExperimentalFeatures.h"
+
+#include "core/experiments/Experiments.h"
+#include "platform/RuntimeEnabledFeatures.h"
+
+namespace blink {
+{% for feature in features %}
+{% if feature.api_name %}
+
+// static
+bool ExperimentalFeatures::{{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext, String& errorMessage) {
+ if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled())
+ return true;
+ return Experiments::isApiEnabled(executionContext, "{{feature.api_name}}", errorMessage);
+}
+{% endif %}
+{% endfor %}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698