| OLD | NEW |
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {{license()}} | 2 {{license()}} |
| 3 | 3 |
| 4 #include "core/origin_trials/OriginTrials.h" | 4 #include "core/origin_trials/OriginTrials.h" |
| 5 | 5 |
| 6 #include "core/origin_trials/OriginTrialContext.h" | 6 #include "core/origin_trials/OriginTrialContext.h" |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 {% for feature in features %} | 11 {% for feature in features %} |
| 12 {% if feature.origin_trial_feature_name %} | 12 {% if feature.origin_trial_feature_name %} |
| 13 | 13 |
| 14 bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu
tionContext) { | 14 bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu
tionContext) { |
| 15 if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled()) | 15 if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled()) |
| 16 return true; | 16 return true; |
| 17 {% if feature.origin_trial_os %} | 17 {% if feature.origin_trial_os %} |
| 18 #if | 18 #if |
| 19 {%- for os in feature.origin_trial_os %} | 19 {%- for os in feature.origin_trial_os %} |
| 20 {%- if not loop.first %} ||{% endif %} | 20 {%- if not loop.first %} ||{% endif %} |
| 21 defined(OS_{{os | upper}}) | 21 defined(OS_{{os | upper}}) |
| 22 {%- endfor %} | 22 {%- endfor %} |
| 23 {% endif %} | 23 {% endif %} |
| 24 | 24 |
| 25 OriginTrialContext* context =OriginTrialContext::from(executionContext, | 25 OriginTrialContext* context =OriginTrialContext::from(executionContext, |
| 26 OriginTrialContext::DontCreateIfNotExists); | 26 OriginTrialContext::kDontCreateIfNotExists); |
| 27 return context && context->isTrialEnabled("{{feature.origin_trial_feature_name
}}"); | 27 return context && context->isTrialEnabled("{{feature.origin_trial_feature_name
}}"); |
| 28 {% if feature.origin_trial_os %} | 28 {% if feature.origin_trial_os %} |
| 29 #else | 29 #else |
| 30 return false; | 30 return false; |
| 31 #endif | 31 #endif |
| 32 {% endif %} | 32 {% endif %} |
| 33 } | 33 } |
| 34 | 34 |
| 35 {% endif %} | 35 {% endif %} |
| 36 {% endfor %} | 36 {% endfor %} |
| 37 | 37 |
| 38 } // namespace blink | 38 } // namespace blink |
| OLD | NEW |