blob: 37c260202720e13c49461aae64b4ca2d6012fc3d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
|