Commit f46c0749 authored by Christian Fremerey's avatar Christian Fremerey Committed by Commit Bot

[Video Capture Service] Add secondary feature flag as a kill switch

Adds a new secondary base::Feature for controlling whether or not
the video capture service is enabled. This gets enabled by default
and serves as a kill switch for groups of devices that force the
primary switch enabled via command-line argument.

Design Doc: https://docs.google.com/document/d/1n9I_DfuNGIA7PUWHOX2O2HVnI1d87q7W7lNTqVZkm0Y/edit?usp=sharing

Bug: 870819
Change-Id: Idd861e838f12a72b54e1140bc3fc613ee5b53018
Reviewed-on: https://chromium-review.googlesource.com/1168001
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583847}
parent dea0b13b
......@@ -271,6 +271,13 @@ const base::Feature kMojoVideoCapture {
#endif
};
// A secondary switch used in combination with kMojoVideoCapture.
// This is intended as a kill switch to allow disabling the service on
// particular groups of devices even if they forcibly enable kMojoVideoCapture
// via a command-line argument.
const base::Feature kMojoVideoCaptureSecondary{
"MojoVideoCaptureSecondary", base::FEATURE_ENABLED_BY_DEFAULT};
// If the network service is enabled, runs it in process.
const base::Feature kNetworkServiceInProcess{"NetworkServiceInProcess",
base::FEATURE_DISABLED_BY_DEFAULT};
......@@ -691,8 +698,13 @@ enum class VideoCaptureServiceConfiguration {
kDisabled
};
bool ShouldEnableVideoCaptureService() {
return base::FeatureList::IsEnabled(features::kMojoVideoCapture) &&
base::FeatureList::IsEnabled(features::kMojoVideoCaptureSecondary);
}
VideoCaptureServiceConfiguration GetVideoCaptureServiceConfiguration() {
if (!base::FeatureList::IsEnabled(features::kMojoVideoCapture))
if (!ShouldEnableVideoCaptureService())
return VideoCaptureServiceConfiguration::kDisabled;
#if defined(OS_ANDROID)
......
......@@ -69,6 +69,7 @@ CONTENT_EXPORT extern const base::Feature kModuleScriptsDynamicImport;
CONTENT_EXPORT extern const base::Feature kModuleScriptsImportMetaUrl;
CONTENT_EXPORT extern const base::Feature kMojoSessionStorage;
CONTENT_EXPORT extern const base::Feature kMojoVideoCapture;
CONTENT_EXPORT extern const base::Feature kMojoVideoCaptureSecondary;
CONTENT_EXPORT extern const base::Feature kNetworkServiceInProcess;
CONTENT_EXPORT extern const base::Feature kNotificationContentImage;
CONTENT_EXPORT extern const base::Feature kOriginPolicy;
......
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