Chromium Code Reviews| 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..1390a13fb40920adf79d06fe8e1597566822dd3a |
| --- /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.experimental_feature_name %} |
|
chasej
2016/01/26 16:56:52
Subject to change, based on comment on naming for
iclelland
2016/01/26 19:05:48
Acknowledged.
iclelland
2016/01/27 18:56:46
Done.
|
| + |
| +// 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.experimental_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.experimental_feature_name}}", errorMessage); |
| +} |
| +{% endif %} |
| +{% endfor %} |
| + |
| +} // namespace blink |