Commit 24620760 authored by Ian Clelland's avatar Ian Clelland Committed by Commit Bot

Move 'wake-lock' feature policy feature behind runtime flag

This ensures that the 'wake-lock' feature is not parsed in feature
policy directives unless the WakeLock runtime flag is enabled.

Bug: 925454
Change-Id: Ic8043be2f499295f4246d99866180c2aab222ad7
Reviewed-on: https://chromium-review.googlesource.com/c/1436201Reviewed-by: default avatarRick Byers <rbyers@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626229}
parent b6146b46
...@@ -256,8 +256,6 @@ const FeatureNameMap& GetDefaultFeatureNameMap() { ...@@ -256,8 +256,6 @@ const FeatureNameMap& GetDefaultFeatureNameMap() {
ASSERT_ORIGIN_TRIAL(WebVR); ASSERT_ORIGIN_TRIAL(WebVR);
ASSERT_ORIGIN_TRIAL(WebXR); ASSERT_ORIGIN_TRIAL(WebXR);
default_feature_name_map.Set("vr", mojom::FeaturePolicyFeature::kWebVr); default_feature_name_map.Set("vr", mojom::FeaturePolicyFeature::kWebVr);
default_feature_name_map.Set("wake-lock",
mojom::FeaturePolicyFeature::kWakeLock);
if (RuntimeEnabledFeatures::ExperimentalProductivityFeaturesEnabled()) { if (RuntimeEnabledFeatures::ExperimentalProductivityFeaturesEnabled()) {
default_feature_name_map.Set( default_feature_name_map.Set(
"layout-animations", mojom::FeaturePolicyFeature::kLayoutAnimations); "layout-animations", mojom::FeaturePolicyFeature::kLayoutAnimations);
...@@ -303,6 +301,10 @@ const FeatureNameMap& GetDefaultFeatureNameMap() { ...@@ -303,6 +301,10 @@ const FeatureNameMap& GetDefaultFeatureNameMap() {
default_feature_name_map.Set("magnetometer", default_feature_name_map.Set("magnetometer",
mojom::FeaturePolicyFeature::kMagnetometer); mojom::FeaturePolicyFeature::kMagnetometer);
} }
if (RuntimeEnabledFeatures::WakeLockEnabled()) {
default_feature_name_map.Set("wake-lock",
mojom::FeaturePolicyFeature::kWakeLock);
}
if (RuntimeEnabledFeatures::WebUSBEnabled()) { if (RuntimeEnabledFeatures::WebUSBEnabled()) {
default_feature_name_map.Set("usb", mojom::FeaturePolicyFeature::kUsb); default_feature_name_map.Set("usb", mojom::FeaturePolicyFeature::kUsb);
} }
......
...@@ -18,5 +18,4 @@ speaker ...@@ -18,5 +18,4 @@ speaker
sync-xhr sync-xhr
usb usb
vr vr
wake-lock
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