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 2f16adf781b1b19f52c41d4bd00ee23aae6ebcf2..7c3d75b29ad22a9cd6fc10380eff06a053c240e3 100644 |
--- a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl |
+++ b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl |
@@ -14,8 +14,21 @@ namespace blink { |
bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext) { |
if (RuntimeEnabledFeatures::{{feature.first_lowered_name}}Enabled()) |
return true; |
+{% if feature.origin_trial_os_whitelist %} |
+#if |
+{%- for os in feature.origin_trial_os_whitelist %} |
+{%- if not loop.first %} ||{% endif %} |
+ defined(OS_{{os | upper}}) |
+{%- endfor %} |
+{% endif %} |
+ |
OriginTrialContext* context = OriginTrialContext::from(executionContext, OriginTrialContext::DontCreateIfNotExists); |
return context && context->isFeatureEnabled("{{feature.origin_trial_feature_name}}"); |
+{% if feature.origin_trial_os_whitelist %} |
+#else |
+ return false; |
+#endif |
+{% endif %} |
} |
{% endif %} |