1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "content/public/common/content_features.h"
6 #include "base/feature_list.h"
7 #include "build/build_config.h"
8 
9 #if defined(OS_WIN)
10 #include "base/win/windows_version.h"
11 #endif
12 
13 namespace features {
14 
15 // All features in alphabetical order.
16 
17 // Enables the allowActivationDelegation attribute on iframes.
18 // https://www.chromestatus.com/features/6025124331388928
19 //
20 // TODO(mustaq): Deprecated, see kUserActivationPostMessageTransfer.
21 const base::Feature kAllowActivationDelegationAttr{
22     "AllowActivationDelegationAttr", base::FEATURE_DISABLED_BY_DEFAULT};
23 
24 // Enables content-initiated, main frame navigations to data URLs.
25 // TODO(meacer): Remove when the deprecation is complete.
26 //               https://www.chromestatus.com/feature/5669602927312896
27 const base::Feature kAllowContentInitiatedDataUrlNavigations{
28     "AllowContentInitiatedDataUrlNavigations",
29     base::FEATURE_DISABLED_BY_DEFAULT};
30 
31 // Accepts Origin-Signed HTTP Exchanges to be signed with certificates
32 // that do not have CanSignHttpExchangesDraft extension.
33 // TODO(https://crbug.com/862003): Remove when certificates with
34 // CanSignHttpExchangesDraft extension are available from trusted CAs.
35 const base::Feature kAllowSignedHTTPExchangeCertsWithoutExtension{
36     "AllowSignedHTTPExchangeCertsWithoutExtension",
37     base::FEATURE_DISABLED_BY_DEFAULT};
38 
39 // Allows Blink to request fonts from the Android Downloadable Fonts API through
40 // the service implemented on the Java side.
41 const base::Feature kAndroidDownloadableFontsMatching{
42     "AndroidDownloadableFontsMatching", base::FEATURE_ENABLED_BY_DEFAULT};
43 
44 // Launches the audio service on the browser startup.
45 const base::Feature kAudioServiceLaunchOnStartup{
46     "AudioServiceLaunchOnStartup", base::FEATURE_DISABLED_BY_DEFAULT};
47 
48 // Runs the audio service in a separate process.
49 const base::Feature kAudioServiceOutOfProcess {
50   "AudioServiceOutOfProcess",
51 #if defined(OS_WIN) || defined(OS_MAC) || \
52     (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_BSD)
53       base::FEATURE_ENABLED_BY_DEFAULT
54 #else
55       base::FEATURE_DISABLED_BY_DEFAULT
56 #endif
57 };
58 
59 // Enables the audio-service sandbox. This feature has an effect only when the
60 // kAudioServiceOutOfProcess feature is enabled.
61 const base::Feature kAudioServiceSandbox {
62   "AudioServiceSandbox",
63 #if defined(OS_WIN) || defined(OS_MAC)
64       base::FEATURE_ENABLED_BY_DEFAULT
65 #else
66       base::FEATURE_DISABLED_BY_DEFAULT
67 #endif
68 };
69 
70 // Kill switch for Background Fetch.
71 const base::Feature kBackgroundFetch{"BackgroundFetch",
72                                      base::FEATURE_ENABLED_BY_DEFAULT};
73 
74 // Enable using the BackForwardCache.
75 const base::Feature kBackForwardCache{"BackForwardCache",
76                                       base::FEATURE_DISABLED_BY_DEFAULT};
77 
78 // BackForwardCache is disabled on low memory devices. The threshold is defined
79 // via a field trial param: "memory_threshold_for_back_forward_cache_in_mb"
80 // It is compared against base::SysInfo::AmountOfPhysicalMemoryMB().
81 
82 // "BackForwardCacheMemoryControls" is checked before "BackForwardCache". It
83 // means the low memory devices will activate neither the control group nor the
84 // experimental group of the BackForwardCache field trial.
85 const base::Feature kBackForwardCacheMemoryControl{
86     "BackForwardCacheMemoryControls", base::FEATURE_DISABLED_BY_DEFAULT};
87 
88 // Block subresource requests whose URLs contain embedded credentials (e.g.
89 // `https://user:pass@example.com/resource`).
90 const base::Feature kBlockCredentialedSubresources{
91     "BlockCredentialedSubresources", base::FEATURE_ENABLED_BY_DEFAULT};
92 
93 // When kBlockInsecurePrivateNetworkRequests is enabled, requests initiated
94 // from a less-private network may only target a more-private network if the
95 // initiating context is secure.
96 //
97 // https://wicg.github.io/cors-rfc1918/#integration-fetch
98 const base::Feature kBlockInsecurePrivateNetworkRequests{
99     "BlockInsecurePrivateNetworkRequests", base::FEATURE_DISABLED_BY_DEFAULT};
100 
101 // Use ThreadPriority::DISPLAY for browser UI and IO threads.
102 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
103 const base::Feature kBrowserUseDisplayThreadPriority{
104     "BrowserUseDisplayThreadPriority", base::FEATURE_ENABLED_BY_DEFAULT};
105 #else
106 const base::Feature kBrowserUseDisplayThreadPriority{
107     "BrowserUseDisplayThreadPriority", base::FEATURE_DISABLED_BY_DEFAULT};
108 #endif
109 
110 // When enabled, keyboard user activation will be verified by the browser side.
111 const base::Feature kBrowserVerifiedUserActivationKeyboard{
112     "BrowserVerifiedUserActivationKeyboard", base::FEATURE_DISABLED_BY_DEFAULT};
113 
114 // When enabled, mouse user activation will be verified by the browser side.
115 const base::Feature kBrowserVerifiedUserActivationMouse{
116     "BrowserVerifiedUserActivationMouse", base::FEATURE_DISABLED_BY_DEFAULT};
117 
118 // Enables code caching for inline scripts.
119 const base::Feature kCacheInlineScriptCode{"CacheInlineScriptCode",
120                                            base::FEATURE_ENABLED_BY_DEFAULT};
121 
122 // Enables support for parallel cache_storage operations via the
123 // "max_shared_ops" fieldtrial parameter.
124 const base::Feature kCacheStorageParallelOps{"CacheStorageParallelOps",
125                                              base::FEATURE_ENABLED_BY_DEFAULT};
126 
127 // If Canvas2D Image Chromium is allowed, this feature controls whether it is
128 // enabled.
129 const base::Feature kCanvas2DImageChromium {
130   "Canvas2DImageChromium",
131 #if defined(OS_MAC)
132       base::FEATURE_ENABLED_BY_DEFAULT
133 #else
134       base::FEATURE_DISABLED_BY_DEFAULT
135 #endif
136 };
137 
138 // Enables the use of out of process rasterization for canvas.
139 const base::Feature kCanvasOopRasterization{"CanvasOopRasterization",
140                                             base::FEATURE_DISABLED_BY_DEFAULT};
141 
142 // Clear the frame name for the top-level cross-browsing-context-group
143 // navigation.
144 const base::Feature kClearCrossBrowsingContextGroupMainFrameName{
145     "ClearCrossBrowsingContextGroupMainFrameName",
146     base::FEATURE_DISABLED_BY_DEFAULT};
147 
148 const base::Feature kClickPointerEvent{"ClickPointerEvent",
149                                        base::FEATURE_DISABLED_BY_DEFAULT};
150 
151 // When enabled, code cache does not use a browsing_data filter for deletions.
152 extern const base::Feature kCodeCacheDeletionWithoutFilter{
153     "CodeCacheDeletionWithoutFilter", base::FEATURE_ENABLED_BY_DEFAULT};
154 
155 // When enabled, event.movement is calculated in blink instead of in browser.
156 const base::Feature kConsolidatedMovementXY{"ConsolidatedMovementXY",
157                                             base::FEATURE_ENABLED_BY_DEFAULT};
158 
159 // Controls whether the Conversion Measurement API is enabled.
160 const base::Feature kConversionMeasurement{"ConversionMeasurement",
161                                            base::FEATURE_DISABLED_BY_DEFAULT};
162 
163 // Show messages in DevTools about upcoming deprecations that would affect
164 // sent/received cookies.
165 const base::Feature kCookieDeprecationMessages{
166     "CookieDeprecationMessages", base::FEATURE_ENABLED_BY_DEFAULT};
167 
168 // Enables Blink cooperative scheduling.
169 const base::Feature kCooperativeScheduling{"CooperativeScheduling",
170                                            base::FEATURE_DISABLED_BY_DEFAULT};
171 
172 // Enables crash reporting via Reporting API.
173 // https://www.w3.org/TR/reporting/#crash-report
174 const base::Feature kCrashReporting{"CrashReporting",
175                                     base::FEATURE_ENABLED_BY_DEFAULT};
176 
177 // Enables support for the `Critical-CH` response header.
178 // https://github.com/WICG/client-hints-infrastructure/blob/master/reliability.md#critical-ch
179 const base::Feature kCriticalClientHint{"CriticalClientHint",
180                                         base::FEATURE_DISABLED_BY_DEFAULT};
181 
182 // Puts save-data header in the holdback mode. This disables sending of
183 // save-data header to origins, and to the renderer processes within Chrome.
184 const base::Feature kDataSaverHoldback{"DataSaverHoldback",
185                                        base::FEATURE_DISABLED_BY_DEFAULT};
186 
187 // Enable changing source dynamically for desktop capture.
188 const base::Feature kDesktopCaptureChangeSource{
189     "DesktopCaptureChangeSource", base::FEATURE_ENABLED_BY_DEFAULT};
190 
191 // Enable document policy for configuring and restricting feature behavior.
192 const base::Feature kDocumentPolicy{"DocumentPolicy",
193                                     base::FEATURE_ENABLED_BY_DEFAULT};
194 
195 // Enable document policy negotiation mechanism.
196 const base::Feature kDocumentPolicyNegotiation{
197     "DocumentPolicyNegotiation", base::FEATURE_DISABLED_BY_DEFAULT};
198 
199 // Enables new canvas 2d api features. Enabled either with either
200 // enable-experimental-canvas-features or new-canvas-2d-api runtime flags
201 const base::Feature kEnableNewCanvas2DAPI{"EnableNewCanvas2DAPI",
202                                           base::FEATURE_DISABLED_BY_DEFAULT};
203 
204 // If this feature is enabled and device permission is not granted by the user,
205 // media-device enumeration will provide at most one device per type and the
206 // device IDs will not be available.
207 // TODO(crbug.com/1019176): remove the feature in M89.
208 const base::Feature kEnumerateDevicesHideDeviceIDs{
209   "EnumerateDevicesHideDeviceIDs",
210 #if defined(OS_ANDROID)
211       base::FEATURE_DISABLED_BY_DEFAULT
212 #else
213       base::FEATURE_ENABLED_BY_DEFAULT
214 #endif
215 };
216 
217 // When a screen reader is detected, allow users the option of letting
218 // Google provide descriptions for unlabeled images.
219 const base::Feature kExperimentalAccessibilityLabels{
220   "ExperimentalAccessibilityLabels",
221 #if defined(OS_ANDROID)
222       base::FEATURE_DISABLED_BY_DEFAULT
223 #else
224       base::FEATURE_ENABLED_BY_DEFAULT
225 #endif
226 };
227 
228 // Throttle tasks in Blink background timer queues based on CPU budgets
229 // for the background tab. Bug: https://crbug.com/639852.
230 const base::Feature kExpensiveBackgroundTimerThrottling{
231     "ExpensiveBackgroundTimerThrottling", base::FEATURE_ENABLED_BY_DEFAULT};
232 
233 // Extra CORS safelisted headers. See https://crbug.com/999054.
234 const base::Feature kExtraSafelistedRequestHeadersForOutOfBlinkCors{
235     "ExtraSafelistedRequestHeadersForOutOfBlinkCors",
236     base::FEATURE_DISABLED_BY_DEFAULT};
237 
238 // Controls whether Client Hints are guarded by FeaturePolicy.
239 const base::Feature kFeaturePolicyForClientHints{
240     "FeaturePolicyForClientHints", base::FEATURE_ENABLED_BY_DEFAULT};
241 
242 // When enabled Feature Policy propagation is similar to sandbox flags and,
243 // sandbox flags are implemented on top of Feature Policy.
244 const base::Feature kFeaturePolicyForSandbox{"FeaturePolicyForSandbox",
245                                              base::FEATURE_DISABLED_BY_DEFAULT};
246 
247 // Controls whether or not First Scroll Latency will be measured and reported.
248 // First Scroll Latency (tracking bug: crbug.com/922980) measures, for the
249 // first scroll of a navigation, the latency between the user's input and the
250 // display's update.
251 const base::Feature kFirstScrollLatencyMeasurement{
252     "FirstScrollLatencyMeasurement", base::FEATURE_ENABLED_BY_DEFAULT};
253 
254 // Enables fixes for matching src: local() for web fonts correctly against full
255 // font name or postscript name. Rolling out behind a flag, as enabling this
256 // enables a font indexer on Android which we need to test in the field first.
257 const base::Feature kFontSrcLocalMatching{"FontSrcLocalMatching",
258                                           base::FEATURE_ENABLED_BY_DEFAULT};
259 
260 #if !defined(OS_ANDROID)
261 // Feature controlling whether or not memory pressure signals will be forwarded
262 // to the GPU process.
263 const base::Feature kForwardMemoryPressureEventsToGpuProcess {
264   "ForwardMemoryPressureEventsToGpuProcess",
265 #if defined(OS_FUCHSIA) || defined(OS_WIN)
266       base::FEATURE_ENABLED_BY_DEFAULT
267 #else
268       base::FEATURE_DISABLED_BY_DEFAULT
269 #endif
270 };
271 #endif
272 
273 // Enables scrollers inside Blink to store scroll offsets in fractional
274 // floating-point numbers rather than truncating to integers.
275 const base::Feature kFractionalScrollOffsets{"FractionalScrollOffsets",
276                                              base::FEATURE_DISABLED_BY_DEFAULT};
277 
278 // Puts network quality estimate related Web APIs in the holdback mode. When the
279 // holdback is enabled the related Web APIs return network quality estimate
280 // set by the experiment (regardless of the actual quality).
281 const base::Feature kNetworkQualityEstimatorWebHoldback{
282     "NetworkQualityEstimatorWebHoldback", base::FEATURE_DISABLED_BY_DEFAULT};
283 
284 // Determines if an extra brand version pair containing possibly escaped double
285 // quotes and escaped backslashed should be added to the Sec-CH-UA header
286 // (activated by kUserAgentClientHint)
287 const base::Feature kGreaseUACH{"GreaseUACH", base::FEATURE_ENABLED_BY_DEFAULT};
288 
289 // If a page does a client side redirect or adds to the history without a user
290 // gesture, then skip it on back/forward UI.
291 const base::Feature kHistoryManipulationIntervention{
292     "HistoryManipulationIntervention", base::FEATURE_ENABLED_BY_DEFAULT};
293 
294 // Prevents sandboxed iframes from using the history API to navigate frames
295 // outside their subttree, if they are restricted from doing top-level
296 // navigations.
297 const base::Feature kHistoryPreventSandboxedNavigation{
298     "HistoryPreventSandboxedNavigation", base::FEATURE_ENABLED_BY_DEFAULT};
299 
300 // This is intended as a kill switch for the Idle Detection feature. To enable
301 // this feature, the experimental web platform features flag should be set,
302 // or the site should obtain an Origin Trial token.
303 const base::Feature kIdleDetection{"IdleDetection",
304                                    base::FEATURE_ENABLED_BY_DEFAULT};
305 
306 // Kill switch for the GetInstalledRelatedApps API.
307 const base::Feature kInstalledApp{"InstalledApp",
308                                   base::FEATURE_ENABLED_BY_DEFAULT};
309 
310 // Allow Windows specific implementation for the GetInstalledRelatedApps API.
311 const base::Feature kInstalledAppProvider{"InstalledAppProvider",
312                                           base::FEATURE_ENABLED_BY_DEFAULT};
313 
314 // Show warning about clearing data from installed apps in the clear browsing
315 // data flow. The warning will be shown in a second dialog.
316 const base::Feature kInstalledAppsInCbd{"InstalledAppsInCbd",
317                                         base::FEATURE_DISABLED_BY_DEFAULT};
318 
319 // Alternative to switches::kIsolateOrigins, for turning on origin isolation.
320 // List of origins to isolate has to be specified via
321 // kIsolateOriginsFieldTrialParamName.
322 const base::Feature kIsolateOrigins{"IsolateOrigins",
323                                     base::FEATURE_DISABLED_BY_DEFAULT};
324 const char kIsolateOriginsFieldTrialParamName[] = "OriginsList";
325 
326 // Experimental handling of accept-language via client hints.
327 const base::Feature kLangClientHintHeader{"LangClientHintHeader",
328                                           base::FEATURE_DISABLED_BY_DEFAULT};
329 
330 const base::Feature kLazyFrameLoading{"LazyFrameLoading",
331                                       base::FEATURE_ENABLED_BY_DEFAULT};
332 const base::Feature kLazyFrameVisibleLoadTimeMetrics {
333   "LazyFrameVisibleLoadTimeMetrics",
334 #if defined(OS_ANDROID)
335       base::FEATURE_ENABLED_BY_DEFAULT
336 #else
337       base::FEATURE_DISABLED_BY_DEFAULT
338 #endif
339 };
340 const base::Feature kLazyImageLoading{"LazyImageLoading",
341                                       base::FEATURE_ENABLED_BY_DEFAULT};
342 const base::Feature kLazyImageVisibleLoadTimeMetrics {
343   "LazyImageVisibleLoadTimeMetrics",
344 #if defined(OS_ANDROID)
345       base::FEATURE_ENABLED_BY_DEFAULT
346 #else
347       base::FEATURE_DISABLED_BY_DEFAULT
348 #endif
349 };
350 
351 // Enable lazy initialization of the media controls.
352 const base::Feature kLazyInitializeMediaControls{
353     "LazyInitializeMediaControls", base::FEATURE_ENABLED_BY_DEFAULT};
354 
355 // Configures whether Blink on Windows 8.0 and below should use out of process
356 // API font fallback calls to retrieve a fallback font family name as opposed to
357 // using a hard-coded font lookup table.
358 const base::Feature kLegacyWindowsDWriteFontFallback{
359     "LegacyWindowsDWriteFontFallback", base::FEATURE_DISABLED_BY_DEFAULT};
360 
361 const base::Feature kLogJsConsoleMessages {
362   "LogJsConsoleMessages",
363 #if defined(OS_ANDROID)
364       base::FEATURE_DISABLED_BY_DEFAULT
365 #else
366       base::FEATURE_ENABLED_BY_DEFAULT
367 #endif
368 };
369 
370 // Removes the association between the `AgentSchedulingGroup` interfaces and the
371 // IPC Channel. This will break ordering guarantees between different agent
372 // scheduling groups (ordering withing a group is still preserved).
373 // DO NOT USE! The feature is not yet fully implemented. See crbug.com/1111231.
374 const base::Feature kMbiDetachAgentSchedulingGroupFromChannel{
375     "MbiDetachAgentSchedulingGroupFromChannel",
376     base::FEATURE_DISABLED_BY_DEFAULT};
377 
378 // If this feature is enabled, media-device enumerations use a cache that is
379 // invalidated upon notifications sent by base::SystemMonitor. If disabled, the
380 // cache is considered invalid on every enumeration request.
381 const base::Feature kMediaDevicesSystemMonitorCache {
382   "MediaDevicesSystemMonitorCaching",
383 #if defined(OS_MAC) || defined(OS_WIN)
384       base::FEATURE_ENABLED_BY_DEFAULT
385 #else
386       base::FEATURE_DISABLED_BY_DEFAULT
387 #endif
388 };
389 
390 // If enabled Mojo uses a dedicated background thread to listen for incoming
391 // IPCs. Otherwise it's configured to use Content's IO thread for that purpose.
392 const base::Feature kMojoDedicatedThread{"MojoDedicatedThread",
393                                          base::FEATURE_DISABLED_BY_DEFAULT};
394 
395 // Enables/disables the video capture service.
396 const base::Feature kMojoVideoCapture{"MojoVideoCapture",
397                                       base::FEATURE_ENABLED_BY_DEFAULT};
398 
399 // A secondary switch used in combination with kMojoVideoCapture.
400 // This is intended as a kill switch to allow disabling the service on
401 // particular groups of devices even if they forcibly enable kMojoVideoCapture
402 // via a command-line argument.
403 const base::Feature kMojoVideoCaptureSecondary{
404     "MojoVideoCaptureSecondary", base::FEATURE_ENABLED_BY_DEFAULT};
405 
406 // When enable, iframe does not implicit capture mouse event.
407 const base::Feature kMouseSubframeNoImplicitCapture{
408     "MouseSubframeNoImplicitCapture", base::FEATURE_DISABLED_BY_DEFAULT};
409 
410 // If the network service is enabled, runs it in process.
411 const base::Feature kNetworkServiceInProcess {
412   "NetworkServiceInProcess",
413 #if defined(OS_ANDROID)
414       base::FEATURE_ENABLED_BY_DEFAULT
415 #else
416       base::FEATURE_DISABLED_BY_DEFAULT
417 #endif
418 };
419 
420 const base::Feature kNeverSlowMode{"NeverSlowMode",
421                                    base::FEATURE_DISABLED_BY_DEFAULT};
422 
423 // Kill switch for Web Notification content images.
424 const base::Feature kNotificationContentImage{"NotificationContentImage",
425                                               base::FEATURE_ENABLED_BY_DEFAULT};
426 
427 // Enables the notification trigger API.
428 const base::Feature kNotificationTriggers{"NotificationTriggers",
429                                           base::FEATURE_ENABLED_BY_DEFAULT};
430 
431 // Origin Isolation, via a header. See https://crbug.com/1042415
432 // Note that the origin policy-based variant of origin isolation is controlled
433 // by kOriginPolicy, instead.
434 const base::Feature kOriginIsolationHeader{"OriginIsolationHeader",
435                                            base::FEATURE_DISABLED_BY_DEFAULT};
436 
437 // Origin Policy. See https://crbug.com/751996
438 const base::Feature kOriginPolicy{"OriginPolicy",
439                                   base::FEATURE_DISABLED_BY_DEFAULT};
440 
441 // History navigation in response to horizontal overscroll (aka gesture-nav).
442 const base::Feature kOverscrollHistoryNavigation {
443   "OverscrollHistoryNavigation",
444 #if defined(OS_ANDROID)
445       base::FEATURE_DISABLED_BY_DEFAULT
446 #else
447       base::FEATURE_ENABLED_BY_DEFAULT
448 #endif
449 };
450 
451 // Whether web apps can run periodic tasks upon network connectivity.
452 const base::Feature kPeriodicBackgroundSync{"PeriodicBackgroundSync",
453                                             base::FEATURE_DISABLED_BY_DEFAULT};
454 
455 // Enable permission policy for configuring and restricting feature behavior.
456 const base::Feature kPermissionsPolicyHeader{"PermissionsPolicyHeader",
457                                              base::FEATURE_ENABLED_BY_DEFAULT};
458 
459 // If Pepper 3D Image Chromium is allowed, this feature controls whether it is
460 // enabled.
461 const base::Feature kPepper3DImageChromium {
462   "Pepper3DImageChromium",
463 #if defined(OS_MAC)
464       base::FEATURE_ENABLED_BY_DEFAULT
465 #else
466       base::FEATURE_DISABLED_BY_DEFAULT
467 #endif
468 };
469 
470 // Kill-switch to introduce a compatibility breaking restriction.
471 const base::Feature kPepperCrossOriginRedirectRestriction{
472     "PepperCrossOriginRedirectRestriction", base::FEATURE_ENABLED_BY_DEFAULT};
473 
474 // Enables process sharing for sites that do not require a dedicated process
475 // by using a default SiteInstance. Default SiteInstances will only be used
476 // on platforms that do not use full site isolation.
477 // Note: This feature is mutally exclusive with
478 // kProcessSharingWithStrictSiteInstances. Only one of these should be enabled
479 // at a time.
480 const base::Feature kProcessSharingWithDefaultSiteInstances{
481     "ProcessSharingWithDefaultSiteInstances", base::FEATURE_ENABLED_BY_DEFAULT};
482 
483 // Whether cross-site frames should get their own SiteInstance even when
484 // strict site isolation is disabled. These SiteInstances will still be
485 // grouped into a shared default process based on BrowsingInstance.
486 const base::Feature kProcessSharingWithStrictSiteInstances{
487     "ProcessSharingWithStrictSiteInstances", base::FEATURE_DISABLED_BY_DEFAULT};
488 
489 // Tells the RenderFrameHost to send beforeunload messages on a different
490 // local frame interface which will handle the messages at a higher priority.
491 const base::Feature kHighPriorityBeforeUnload{
492     "HighPriorityBeforeUnload", base::FEATURE_DISABLED_BY_DEFAULT};
493 
494 // Under this flag bootstrap (aka startup) tasks will be prioritized. This flag
495 // is used by various modules to determine whether special scheduling
496 // arrangements need to be made to prioritize certain tasks.
497 const base::Feature kPrioritizeBootstrapTasks = {
498     "PrioritizeBootstrapTasks", base::FEATURE_ENABLED_BY_DEFAULT};
499 
500 // Enable the ProactivelySwapBrowsingInstance experiment. A browsing instance
501 // represents a set of frames that can script each other. Currently, Chrome does
502 // not always switch BrowsingInstance when navigating in between two unrelated
503 // pages. This experiment makes Chrome swap BrowsingInstances for cross-site
504 // HTTP(S) navigations when the BrowsingInstance doesn't contain any other
505 // windows.
506 const base::Feature kProactivelySwapBrowsingInstance{
507     "ProactivelySwapBrowsingInstance", base::FEATURE_DISABLED_BY_DEFAULT};
508 
509 // Fires the `pushsubscriptionchange` event defined here:
510 // https://w3c.github.io/push-api/#the-pushsubscriptionchange-event
511 // for subscription refreshes, revoked permissions or subscription losses
512 const base::Feature kPushSubscriptionChangeEvent{
513     "PushSubscriptionChangeEvent", base::FEATURE_DISABLED_BY_DEFAULT};
514 
515 // Enables the Direct Sockets API.
516 const base::Feature kDirectSockets{"DirectSockets",
517                                    base::FEATURE_DISABLED_BY_DEFAULT};
518 
519 // Causes hidden tabs with crashed subframes to be marked for reload, meaning
520 // that if a user later switches to that tab, the current page will be
521 // reloaded.  This will hide crashed subframes from the user at the cost of
522 // extra reloads.
523 const base::Feature kReloadHiddenTabsWithCrashedSubframes {
524   "ReloadHiddenTabsWithCrashedSubframes",
525 #if defined(OS_ANDROID)
526       base::FEATURE_ENABLED_BY_DEFAULT
527 #else
528       base::FEATURE_DISABLED_BY_DEFAULT
529 #endif
530 };
531 
532 // RenderDocument:
533 //
534 // Currently, a RenderFrameHost represents neither a frame nor a document, but a
535 // frame in a given process. A new one is created after a different-process
536 // navigation. The goal of RenderDocument is to get a new one for each document
537 // instead.
538 //
539 // Design doc: https://bit.ly/renderdocument
540 // Main bug tracker: https://crbug.com/936696
541 
542 // Enable using the RenderDocument.
543 const base::Feature kRenderDocument{"RenderDocument",
544                                     base::FEATURE_ENABLED_BY_DEFAULT};
545 // Enables skipping the early call to CommitPending when navigating away from a
546 // crashed frame.
547 const base::Feature kSkipEarlyCommitPendingForCrashedFrame{
548     "SkipEarlyCommitPendingForCrashedFrame", base::FEATURE_DISABLED_BY_DEFAULT};
549 
550 const base::Feature kRequestUnbufferedDispatch{
551     "RequestUnbufferedDispatch", base::FEATURE_ENABLED_BY_DEFAULT};
552 
553 // Respect the MacOS system setting for subpixel text anti-aliasing.
554 // https://crbug.com/1079418.
555 const base::Feature kRespectMacLCDTextSetting{"RespectMacLCDTextSetting",
556                                               base::FEATURE_ENABLED_BY_DEFAULT};
557 
558 // Run video capture service in the Browser process as opposed to a dedicated
559 // utility process
560 const base::Feature kRunVideoCaptureServiceInBrowserProcess{
561     "RunVideoCaptureServiceInBrowserProcess",
562     base::FEATURE_DISABLED_BY_DEFAULT};
563 
564 // Enables saving pages as Web Bundle.
565 const base::Feature kSavePageAsWebBundle{"SavePageAsWebBundle",
566                                          base::FEATURE_DISABLED_BY_DEFAULT};
567 
568 // Used to control whether to remove the restriction that PaymentCredential in
569 // WebAuthn and secure payment confirmation method in PaymentRequest API must
570 // use a user verifying platform authenticator. When enabled, this allows using
571 // such devices as UbiKey on Linux, which can make development easier.
572 const base::Feature kSecurePaymentConfirmationDebug{
573     "SecurePaymentConfirmationDebug", base::FEATURE_DISABLED_BY_DEFAULT};
574 
575 // Make sendBeacon throw for a Blob with a non simple type.
576 const base::Feature kSendBeaconThrowForBlobWithNonSimpleType{
577     "SendBeaconThrowForBlobWithNonSimpleType",
578     base::FEATURE_DISABLED_BY_DEFAULT};
579 
580 // Service worker based payment apps as defined by w3c here:
581 // https://w3c.github.io/webpayments-payment-apps-api/
582 // TODO(rouslan): Remove this.
583 const base::Feature kServiceWorkerPaymentApps{"ServiceWorkerPaymentApps",
584                                               base::FEATURE_ENABLED_BY_DEFAULT};
585 
586 // If enabled, prefer to start service workers in an unused renderer process if
587 // available. This helps let navigations and service workers use the same
588 // process when a process was already created for a navigation but not yet
589 // claimed by it (as is common for navigations from the Android New Tab Page).
590 const base::Feature kServiceWorkerPrefersUnusedProcess{
591     "ServiceWorkerPrefersUnusedProcess", base::FEATURE_DISABLED_BY_DEFAULT};
592 
593 // Use this feature to experiment terminating a service worker when it doesn't
594 // control any clients: https://crbug.com/1043845.
595 const base::Feature kServiceWorkerTerminationOnNoControllee{
596     "ServiceWorkerTerminationOnNoControllee",
597     base::FEATURE_DISABLED_BY_DEFAULT};
598 
599 // http://tc39.github.io/ecmascript_sharedmem/shmem.html
600 const base::Feature kSharedArrayBuffer {
601   "SharedArrayBuffer",
602 #if defined(OS_ANDROID)
603       base::FEATURE_DISABLED_BY_DEFAULT
604 #else
605       base::FEATURE_ENABLED_BY_DEFAULT
606 #endif
607 };
608 
609 // Signed HTTP Exchange prefetch cache for navigations
610 // https://crbug.com/968427
611 const base::Feature kSignedExchangePrefetchCacheForNavigations{
612     "SignedExchangePrefetchCacheForNavigations",
613     base::FEATURE_DISABLED_BY_DEFAULT};
614 
615 // Signed Exchange Reporting for distributors
616 // https://www.chromestatus.com/features/5687904902840320
617 const base::Feature kSignedExchangeReportingForDistributors{
618     "SignedExchangeReportingForDistributors", base::FEATURE_ENABLED_BY_DEFAULT};
619 
620 // Subresource prefetching+loading via Signed HTTP Exchange
621 // https://www.chromestatus.com/features/5126805474246656
622 const base::Feature kSignedExchangeSubresourcePrefetch{
623     "SignedExchangeSubresourcePrefetch", base::FEATURE_ENABLED_BY_DEFAULT};
624 
625 // Origin-Signed HTTP Exchanges (for WebPackage Loading)
626 // https://www.chromestatus.com/features/5745285984681984
627 const base::Feature kSignedHTTPExchange{"SignedHTTPExchange",
628                                         base::FEATURE_ENABLED_BY_DEFAULT};
629 
630 // Whether to send a ping to the inner URL upon navigation or not.
631 const base::Feature kSignedHTTPExchangePingValidity{
632     "SignedHTTPExchangePingValidity", base::FEATURE_DISABLED_BY_DEFAULT};
633 
634 // This is intended as a kill switch for the WebOTP Service feature. To enable
635 // this feature, the experimental web platform features flag should be set,
636 // or the site should obtain an Origin Trial token.
637 const base::Feature kWebOTP{"WebOTP", base::FEATURE_ENABLED_BY_DEFAULT};
638 
639 // Controls whether Site Isolation protects against spoofing of origin in
640 // mojom::FileSystemManager::Open IPC from compromised renderer processes.  See
641 // also https://crbug.com/917457.
642 const base::Feature kSiteIsolationEnforcementForFileSystemApi{
643     "SiteIsolationEnforcementForFileSystemApi",
644     base::FEATURE_ENABLED_BY_DEFAULT};
645 
646 // Controls whether SpareRenderProcessHostManager tries to always have a warm
647 // spare renderer process around for the most recently requested BrowserContext.
648 // This feature is only consulted in site-per-process mode.
649 const base::Feature kSpareRendererForSitePerProcess{
650     "SpareRendererForSitePerProcess", base::FEATURE_ENABLED_BY_DEFAULT};
651 
652 // Enables the out-of-process Storage Service.
653 const base::Feature kStorageServiceOutOfProcess{
654     "StorageServiceOutOfProcess", base::FEATURE_ENABLED_BY_DEFAULT};
655 
656 // Controls whether site isolation should use origins instead of scheme and
657 // eTLD+1.
658 const base::Feature kStrictOriginIsolation{"StrictOriginIsolation",
659                                            base::FEATURE_DISABLED_BY_DEFAULT};
660 
661 // Enables subresource loading with Web Bundles.
662 const base::Feature kSubresourceWebBundles{"SubresourceWebBundles",
663                                            base::FEATURE_DISABLED_BY_DEFAULT};
664 
665 // Dispatch touch events to "SyntheticGestureController" for events from
666 // Devtool Protocol Input.dispatchTouchEvent to simulate touch events close to
667 // real OS events.
668 const base::Feature kSyntheticPointerActions{"SyntheticPointerActions",
669                                              base::FEATURE_DISABLED_BY_DEFAULT};
670 
671 // Throttle Blink timers in out-of-view cross origin frames.
672 const base::Feature kTimerThrottlingForHiddenFrames{
673     "TimerThrottlingForHiddenFrames", base::FEATURE_ENABLED_BY_DEFAULT};
674 
675 // Enables async touchpad pinch zoom events. We check the ACK of the first
676 // synthetic wheel event in a pinch sequence, then send the rest of the
677 // synthetic wheel events of the pinch sequence as non-blocking if the first
678 // event’s ACK is not canceled.
679 const base::Feature kTouchpadAsyncPinchEvents{"TouchpadAsyncPinchEvents",
680                                               base::FEATURE_ENABLED_BY_DEFAULT};
681 
682 // Allows swipe left/right from touchpad change browser navigation. Currently
683 // only enabled by default on CrOS.
684 const base::Feature kTouchpadOverscrollHistoryNavigation {
685   "TouchpadOverscrollHistoryNavigation",
686 #if defined(OS_CHROMEOS) || defined(OS_WIN)
687       base::FEATURE_ENABLED_BY_DEFAULT
688 #else
689       base::FEATURE_DISABLED_BY_DEFAULT
690 #endif
691 };
692 
693 // Controls whether the Trusted Types API is available.
694 const base::Feature kTrustedDOMTypes{"TrustedDOMTypes",
695                                      base::FEATURE_ENABLED_BY_DEFAULT};
696 
697 // Controls whether the RenderProcessHost uses its frames' priorities for
698 // determining if it should be backgrounded. When all frames associated with a
699 // RenderProcessHost are low priority, that process may be backgrounded even if
700 // those frames are visible.
701 const base::Feature kUseFramePriorityInRenderProcessHost{
702     "UseFramePriorityInRenderProcessHost", base::FEATURE_DISABLED_BY_DEFAULT};
703 
704 // Allows user activation propagation to all frames having the same origin as
705 // the activation notifier frame.  This is an intermediate measure before we
706 // have an iframe attribute to declaratively allow user activation propagation
707 // to subframes.
708 const base::Feature kUserActivationSameOriginVisibility{
709     "UserActivationSameOriginVisibility", base::FEATURE_ENABLED_BY_DEFAULT};
710 
711 // An experimental replacement for the `User-Agent` header, defined in
712 // https://tools.ietf.org/html/draft-west-ua-client-hints.
713 const base::Feature kUserAgentClientHint{"UserAgentClientHint",
714                                          base::FEATURE_DISABLED_BY_DEFAULT};
715 
716 // Controls whether the <video>.getVideoPlaybackQuality() API is enabled.
717 const base::Feature kVideoPlaybackQuality{"VideoPlaybackQuality",
718                                           base::FEATURE_ENABLED_BY_DEFAULT};
719 
720 // Enables future V8 VM features
721 const base::Feature kV8VmFuture{"V8VmFuture",
722                                 base::FEATURE_DISABLED_BY_DEFAULT};
723 
724 // Enable display_override manifest entry for web applications.
725 const base::Feature kWebAppManifestDisplayOverride{
726     "WebAppManifestDisplayOverride", base::FEATURE_DISABLED_BY_DEFAULT};
727 
728 // Enable window controls overlays for desktop PWAs
729 const base::Feature kWebAppWindowControlsOverlay{
730     "WebAppWindowControlsOverlay", base::FEATURE_DISABLED_BY_DEFAULT};
731 
732 // Enable WebAssembly baseline compilation (Liftoff).
733 const base::Feature kWebAssemblyBaseline{"WebAssemblyBaseline",
734                                          base::FEATURE_ENABLED_BY_DEFAULT};
735 
736 // Enable WebAssembly lazy compilation (JIT on first call).
737 const base::Feature kWebAssemblyLazyCompilation{
738     "WebAssemblyLazyCompilation", base::FEATURE_DISABLED_BY_DEFAULT};
739 
740 // Enable WebAssembly SIMD.
741 // https://github.com/WebAssembly/Simd
742 const base::Feature kWebAssemblySimd{"WebAssemblySimd",
743                                      base::FEATURE_DISABLED_BY_DEFAULT};
744 
745 // Enable WebAssembly tiering (Liftoff -> TurboFan).
746 const base::Feature kWebAssemblyTiering{"WebAssemblyTiering",
747                                         base::FEATURE_ENABLED_BY_DEFAULT};
748 
749 // Enable WebAssembly threads.
750 // https://github.com/WebAssembly/threads
751 const base::Feature kWebAssemblyThreads {
752   "WebAssemblyThreads",
753 #if defined(OS_ANDROID)
754       base::FEATURE_DISABLED_BY_DEFAULT
755 #else
756       base::FEATURE_ENABLED_BY_DEFAULT
757 #endif
758 };
759 
760 // Enable WebAssembly trap handler.
761 #if (defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_WIN) || defined(OS_BSD) || \
762      defined(OS_MAC)) &&                                                                \
763     defined(ARCH_CPU_X86_64)
764 const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
765                                             base::FEATURE_ENABLED_BY_DEFAULT};
766 #else
767 const base::Feature kWebAssemblyTrapHandler{"WebAssemblyTrapHandler",
768                                             base::FEATURE_DISABLED_BY_DEFAULT};
769 #endif
770 
771 // Controls whether the visibility of a WebContents can be OCCLUDED. When
772 // disabled, an occluded WebContents behaves exactly like a VISIBLE WebContents.
773 const base::Feature kWebContentsOcclusion {
774   "WebContentsOcclusion",
775 #if defined(OS_MAC) || defined(OS_CHROMEOS) || defined(OS_WIN)
776       base::FEATURE_ENABLED_BY_DEFAULT
777 #else
778       base::FEATURE_DISABLED_BY_DEFAULT
779 #endif
780 };
781 
782 // Controls whether the WebAuthentication API is enabled:
783 // https://w3c.github.io/webauthn
784 const base::Feature kWebAuth{"WebAuthentication",
785                              base::FEATURE_ENABLED_BY_DEFAULT};
786 
787 // Controls whether CTAP2 devices can communicate via the WebAuthentication API
788 // using pairingless BLE protocol.
789 // https://w3c.github.io/webauthn
790 const base::Feature kWebAuthCable {
791   "WebAuthenticationCable",
792 #if (!defined(OS_CHROMEOS) && defined(OS_LINUX)) || defined(OS_BSD)
793       base::FEATURE_DISABLED_BY_DEFAULT
794 #else
795       base::FEATURE_ENABLED_BY_DEFAULT
796 #endif
797 };
798 
799 // Controls whether Web Bluetooth should use the new permissions backend. The
800 // new permissions backend uses ChooserContextBase, which is used by other
801 // device APIs, such as WebUSB.
802 const base::Feature kWebBluetoothNewPermissionsBackend{
803     "WebBluetoothNewPermissionsBackend", base::FEATURE_DISABLED_BY_DEFAULT};
804 
805 // Controls whether Web Bundles (Bundled HTTP Exchanges) is enabled.
806 // https://wicg.github.io/webpackage/draft-yasskin-wpack-bundled-exchanges.html
807 // When this feature is enabled, Chromium can load unsigned Web Bundles local
808 // file under file:// URL (and content:// URI on Android).
809 const base::Feature kWebBundles{"WebBundles",
810                                 base::FEATURE_DISABLED_BY_DEFAULT};
811 
812 // When this feature is enabled, Chromium will be able to load unsigned Web
813 // Bundles file under https: URL and localhost http: URL.
814 // TODO(crbug.com/1018640): Implement this feature.
815 const base::Feature kWebBundlesFromNetwork{"WebBundlesFromNetwork",
816                                            base::FEATURE_DISABLED_BY_DEFAULT};
817 
818 // If WebGL Image Chromium is allowed, this feature controls whether it is
819 // enabled.
820 const base::Feature kWebGLImageChromium{"WebGLImageChromium",
821                                         base::FEATURE_ENABLED_BY_DEFAULT};
822 
823 // Enable browser mediation API for federated identity interactions.
824 const base::Feature kWebID{"kWebID", base::FEATURE_DISABLED_BY_DEFAULT};
825 
826 // Enable experimental policy-controlled features and LAPIs
827 const base::Feature kExperimentalProductivityFeatures{
828     "ExperimentalProductivityFeatures", base::FEATURE_DISABLED_BY_DEFAULT};
829 
830 // When this feature is enabled, the Web OTP API will use the User Consent
831 // API to retrieve SMSes from the Android device.
832 const base::Feature kWebOtpBackend{"kWebOtpBackend",
833                                    base::FEATURE_DISABLED_BY_DEFAULT};
834 
835 // The JavaScript API for payments on the web.
836 const base::Feature kWebPayments{"WebPayments",
837                                  base::FEATURE_ENABLED_BY_DEFAULT};
838 
839 // Minimal user interface experience for payments on the web.
840 const base::Feature kWebPaymentsMinimalUI{"WebPaymentsMinimalUI",
841                                           base::FEATURE_DISABLED_BY_DEFAULT};
842 
843 // Use GpuMemoryBuffer backed VideoFrames in media streams.
844 const base::Feature kWebRtcUseGpuMemoryBufferVideoFrames{
845     "WebRTC-UseGpuMemoryBufferVideoFrames", base::FEATURE_ENABLED_BY_DEFAULT};
846 
847 // Enables report-only Trusted Types experiment on WebUIs
848 const base::Feature kWebUIReportOnlyTrustedTypes{
849     "WebUIReportOnlyTrustedTypes", base::FEATURE_DISABLED_BY_DEFAULT};
850 
851 // Controls whether the WebUSB API is enabled:
852 // https://wicg.github.io/webusb
853 const base::Feature kWebUsb{"WebUSB", base::FEATURE_ENABLED_BY_DEFAULT};
854 
855 // Controls whether the WebXR Device API is enabled.
856 const base::Feature kWebXr{"WebXR", base::FEATURE_ENABLED_BY_DEFAULT};
857 
858 // Enables access to AR features via the WebXR API.
859 const base::Feature kWebXrArModule{"WebXRARModule",
860                                    base::FEATURE_ENABLED_BY_DEFAULT};
861 
862 // Enables access to raycasting against estimated XR scene geometry.
863 const base::Feature kWebXrHitTest{"WebXRHitTest",
864                                   base::FEATURE_ENABLED_BY_DEFAULT};
865 
866 // Enables access to experimental WebXR features.
867 const base::Feature kWebXrIncubations{"WebXRIncubations",
868                                       base::FEATURE_DISABLED_BY_DEFAULT};
869 
870 #if defined(OS_ANDROID)
871 // Autofill Accessibility in Android.
872 // crbug.com/627860
873 const base::Feature kAndroidAutofillAccessibility{
874     "AndroidAutofillAccessibility", base::FEATURE_ENABLED_BY_DEFAULT};
875 
876 // Sets moderate binding to background renderers playing media, when enabled.
877 // Else the renderer will have strong binding.
878 const base::Feature kBackgroundMediaRendererHasModerateBinding{
879     "BackgroundMediaRendererHasModerateBinding",
880     base::FEATURE_DISABLED_BY_DEFAULT};
881 
882 // Force display to tick at ~60Hz refresh rate.
883 const base::Feature kForce60HzRefreshRate{"Force60HzRefreshRate",
884                                           base::FEATURE_DISABLED_BY_DEFAULT};
885 
886 // Screen Capture API support for Android
887 const base::Feature kUserMediaScreenCapturing{
888     "UserMediaScreenCapturing", base::FEATURE_DISABLED_BY_DEFAULT};
889 
890 // Pre-warm up the network process on browser startup.
891 const base::Feature kWarmUpNetworkProcess{"WarmUpNetworkProcess",
892                                           base::FEATURE_DISABLED_BY_DEFAULT};
893 
894 // Kill switch for the WebNFC feature. This feature can be enabled for all sites
895 // using the kEnableExperimentalWebPlatformFeatures flag or by a particular site
896 // if it includes an Origin Trial key.  https://w3c.github.io/web-nfc/
897 const base::Feature kWebNfc{"WebNFC", base::FEATURE_ENABLED_BY_DEFAULT};
898 #endif  // defined(OS_ANDROID)
899 
900 #if defined(OS_MAC)
901 // Enables caching of media devices for the purpose of enumerating them.
902 const base::Feature kDeviceMonitorMac{"DeviceMonitorMac",
903                                       base::FEATURE_ENABLED_BY_DEFAULT};
904 
905 // Enable IOSurface based screen capturer.
906 const base::Feature kIOSurfaceCapturer{"IOSurfaceCapturer",
907                                        base::FEATURE_ENABLED_BY_DEFAULT};
908 
909 const base::Feature kMacSyscallSandbox{"MacSyscallSandbox",
910                                        base::FEATURE_DISABLED_BY_DEFAULT};
911 
912 const base::Feature kMacV2GPUSandbox{"MacV2GPUSandbox",
913                                      base::FEATURE_DISABLED_BY_DEFAULT};
914 
915 // Enables retrying to obtain list of available cameras on Macbooks after
916 // restarting the video capture service if a previous attempt delivered zero
917 // cameras.
918 const base::Feature kRetryGetVideoCaptureDeviceInfos{
919     "RetryGetVideoCaptureDeviceInfos", base::FEATURE_DISABLED_BY_DEFAULT};
920 #endif  // defined(OS_MAC)
921 
922 #if !defined(OS_WIN) && !defined(OS_FUCHSIA) && !defined(OS_IOS)
923 // If the JavaScript on a WebUI page has an error (such as an unhandled
924 // exception), report that error back the crash reporting infrastructure, same
925 // as we do for program crashes.
926 const base::Feature kSendWebUIJavaScriptErrorReports{
927     "SendWebUIJavaScriptErrorReports", base::FEATURE_DISABLED_BY_DEFAULT};
928 // Parameter: Should we send the error reports to the production server? If
929 // false, we send to the staging server, which is useful for developers (doesn't
930 // pollute the report database).
931 const char kSendWebUIJavaScriptErrorReportsSendToProductionVariation[] =
932     "send_webui_js_errors_to_production";
933 const base::FeatureParam<bool>
934     kWebUIJavaScriptErrorReportsSendToProductionParam{
935         &kSendWebUIJavaScriptErrorReports,
936         kSendWebUIJavaScriptErrorReportsSendToProductionVariation, true};
937 #endif
938 
939 #if defined(WEBRTC_USE_PIPEWIRE)
940 // Controls whether the PipeWire support for screen capturing is enabled on the
941 // Wayland display server.
942 const base::Feature kWebRtcPipeWireCapturer{"WebRTCPipeWireCapturer",
943                                             base::FEATURE_DISABLED_BY_DEFAULT};
944 #endif  // defined(WEBRTC_USE_PIPEWIRE)
945 
946 enum class VideoCaptureServiceConfiguration {
947   kEnabledForOutOfProcess,
948   kEnabledForBrowserProcess,
949   kDisabled
950 };
951 
ShouldEnableVideoCaptureService()952 bool ShouldEnableVideoCaptureService() {
953   return base::FeatureList::IsEnabled(features::kMojoVideoCapture) &&
954          base::FeatureList::IsEnabled(features::kMojoVideoCaptureSecondary);
955 }
956 
GetVideoCaptureServiceConfiguration()957 VideoCaptureServiceConfiguration GetVideoCaptureServiceConfiguration() {
958   if (!ShouldEnableVideoCaptureService())
959     return VideoCaptureServiceConfiguration::kDisabled;
960 
961 // On ChromeOS the service must run in the browser process, because parts of the
962 // code depend on global objects that are only available in the Browser process.
963 // See https://crbug.com/891961.
964 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
965   return VideoCaptureServiceConfiguration::kEnabledForBrowserProcess;
966 #else
967 #if defined(OS_WIN)
968   if (base::win::GetVersion() <= base::win::Version::WIN7)
969     return VideoCaptureServiceConfiguration::kEnabledForBrowserProcess;
970 #endif
971   return base::FeatureList::IsEnabled(
972              features::kRunVideoCaptureServiceInBrowserProcess)
973              ? VideoCaptureServiceConfiguration::kEnabledForBrowserProcess
974              : VideoCaptureServiceConfiguration::kEnabledForOutOfProcess;
975 #endif
976 }
977 
IsVideoCaptureServiceEnabledForOutOfProcess()978 bool IsVideoCaptureServiceEnabledForOutOfProcess() {
979   return GetVideoCaptureServiceConfiguration() ==
980          VideoCaptureServiceConfiguration::kEnabledForOutOfProcess;
981 }
982 
IsVideoCaptureServiceEnabledForBrowserProcess()983 bool IsVideoCaptureServiceEnabledForBrowserProcess() {
984   return GetVideoCaptureServiceConfiguration() ==
985          VideoCaptureServiceConfiguration::kEnabledForBrowserProcess;
986 }
987 
988 }  // namespace features
989