Commit 4d59fb59 authored by sammc's avatar sammc Committed by Commit bot

Disable WebShare on platforms other than android.

This adds origin_trial_os_whitelist to RuntimeEnabledFeatures. If set,
an origin trial will only be available on the whitelisted OSes.

BUG=635741

Review-Url: https://codereview.chromium.org/2249043002
Cr-Commit-Position: refs/heads/master@{#422981}
parent e9cd023a
......@@ -49,6 +49,7 @@ class RuntimeFeatureWriter(in_generator.Writer):
'feature_policy': None,
'implied_by': [],
'origin_trial_feature_name': None,
'origin_trial_os': [],
'settable_from_internals': False,
'status': None,
}
......
......@@ -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 %}
#if
{%- for os in feature.origin_trial_os %}
{%- 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 %}
#else
return false;
#endif
{% endif %}
}
{% endif %}
......
......@@ -258,7 +258,7 @@ WebFontsInterventionV2With2G
WebFontsInterventionV2With3G
WebFontsInterventionV2WithSlow2G
WebFontsInterventionTrigger
WebShare status=experimental, origin_trial_feature_name=WebShare
WebShare status=experimental, origin_trial_feature_name=WebShare, origin_trial_os=android
Worklet status=experimental
ParseHTMLOnMainThread status=test
SendBeaconThrowForBlobWithNonSimpleType status=experimental
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment