| 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
|
| index 37c260202720e13c49461aae64b4ca2d6012fc3d..e105435344c95060d572ed06a7fcf29e7fd560bc 100644
|
| --- a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl
|
| @@ -3,21 +3,28 @@
|
|
|
| #include "core/origin_trials/OriginTrials.h"
|
|
|
| +#include "core/dom/ExecutionContext.h"
|
| #include "core/origin_trials/OriginTrialContext.h"
|
| #include "platform/RuntimeEnabledFeatures.h"
|
|
|
| namespace blink {
|
| +
|
| +OriginTrials::OriginTrials(OriginTrialContext* originTrialContext) : m_originTrialContext(originTrialContext) {}
|
| +
|
| {% 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);
|
| + return executionContext->originTrials()->{{feature.first_lowered_name}}Enabled(errorMessage);
|
| }
|
|
|
| -// static
|
| -bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext) {
|
| - return {{feature.first_lowered_name}}EnabledImpl(executionContext, nullptr);
|
| +bool OriginTrials::{{feature.first_lowered_name}}Enabled(String& errorMessage) {
|
| + return {{feature.first_lowered_name}}EnabledImpl(&errorMessage);
|
| +}
|
| +
|
| +bool OriginTrials::{{feature.first_lowered_name}}Enabled() {
|
| + return {{feature.first_lowered_name}}EnabledImpl(nullptr);
|
| }
|
| {% endif %}
|
| {% endfor %}
|
| @@ -25,11 +32,11 @@ bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu
|
| {% for feature in features %}
|
| {% if feature.origin_trial_feature_name %}
|
|
|
| -// static
|
| -bool OriginTrials::{{feature.first_lowered_name}}EnabledImpl(ExecutionContext* executionContext, String* errorMessage) {
|
| +bool OriginTrials::{{feature.first_lowered_name}}EnabledImpl(String* errorMessage) {
|
| if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled())
|
| return true;
|
| - return OriginTrialContext::isFeatureEnabled(executionContext, "{{feature.origin_trial_feature_name}}", errorMessage);
|
| + if (!m_originTrialContext) return false;
|
| + return m_originTrialContext->isFeatureEnabled("{{feature.origin_trial_feature_name}}", errorMessage);
|
| }
|
| {% endif %}
|
| {% endfor %}
|
|
|