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

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

Issue 1635593004: Rename Experimental Framework classes and concepts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 11 months 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/OriginTrials.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..37c260202720e13c49461aae64b4ca2d6012fc3d
--- /dev/null
+++ b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl
@@ -0,0 +1,37 @@
+{% from 'macros.tmpl' import license %}
+{{license()}}
+
+#include "core/origin_trials/OriginTrials.h"
+
+#include "core/origin_trials/OriginTrialContext.h"
+#include "platform/RuntimeEnabledFeatures.h"
+
+namespace blink {
+{% for feature in features %}
+{% if feature.origin_trial_feature_name %}
+
+// static
+bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext, String& errorMessage) {
+ return {{feature.first_lowered_name}}EnabledImpl(executionContext, &errorMessage);
+}
+
+// static
+bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext) {
+ return {{feature.first_lowered_name}}EnabledImpl(executionContext, nullptr);
+}
+{% endif %}
+{% endfor %}
+
+{% for feature in features %}
+{% if feature.origin_trial_feature_name %}
+
+// static
+bool OriginTrials::{{feature.first_lowered_name}}EnabledImpl(ExecutionContext* executionContext, String* errorMessage) {
+ if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled())
+ return true;
+ return OriginTrialContext::isFeatureEnabled(executionContext, "{{feature.origin_trial_feature_name}}", errorMessage);
+}
+{% endif %}
+{% endfor %}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698