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

[Video Capture] Add feature switch for DeviceMonitorMac

On Mac it can happen that certain cameras stop working system-wide after Chrome 
has been running for a while (potentially days) and the computer has gone 
through sleep/wakeup cycles.

This could potentially be related to DeviceMonitorMac interacting with 
VDCAssistant either at a bad time or in a bad way. To be able to test this 
theory, this CL adds a feature switch that allows disabling the use of 
DeviceMonitorMac.

Bug: 699446
Test: Run chromium on Mac with --disable-features=DeviceMonitorMac
Change-Id: Id2a06c75bca7ec8e2db37b4b9647fe508edb0327
Reviewed-on: https://chromium-review.googlesource.com/558199Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486933}
parent 745c82af
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "content/browser/renderer_host/media/media_stream_manager.h" #include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/media/video_capture_manager.h" #include "content/browser/renderer_host/media/video_capture_manager.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/common/content_features.h"
#include "media/audio/audio_device_description.h" #include "media/audio/audio_device_description.h"
#include "media/audio/audio_system.h" #include "media/audio/audio_system.h"
#include "media/base/media_switches.h" #include "media/base/media_switches.h"
...@@ -232,6 +233,11 @@ void MediaDevicesManager::StartMonitoring() { ...@@ -232,6 +233,11 @@ void MediaDevicesManager::StartMonitoring() {
if (!base::SystemMonitor::Get()) if (!base::SystemMonitor::Get())
return; return;
#if defined(OS_MACOSX)
if (!base::FeatureList::IsEnabled(features::kDeviceMonitorMac))
return;
#endif
monitoring_started_ = true; monitoring_started_ = true;
base::SystemMonitor::Get()->AddDevicesChangedObserver(this); base::SystemMonitor::Get()->AddDevicesChangedObserver(this);
......
...@@ -411,6 +411,10 @@ const base::Feature kWinSboxDisableExtensionPoints{ ...@@ -411,6 +411,10 @@ const base::Feature kWinSboxDisableExtensionPoints{
#endif #endif
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Enables caching of media devices for the purpose of enumerating them.
const base::Feature kDeviceMonitorMac{"DeviceMonitorMac",
base::FEATURE_ENABLED_BY_DEFAULT};
// The V2 sandbox on MacOS removes the unsandboed warmup phase and sandboxes the // The V2 sandbox on MacOS removes the unsandboed warmup phase and sandboxes the
// entire life of the process. // entire life of the process.
const base::Feature kMacV2Sandbox{"MacV2Sandbox", const base::Feature kMacV2Sandbox{"MacV2Sandbox",
......
...@@ -109,6 +109,7 @@ CONTENT_EXPORT extern const base::Feature kWinSboxDisableExtensionPoints; ...@@ -109,6 +109,7 @@ CONTENT_EXPORT extern const base::Feature kWinSboxDisableExtensionPoints;
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
CONTENT_EXPORT extern const base::Feature kDeviceMonitorMac;
CONTENT_EXPORT extern const base::Feature kMacV2Sandbox; CONTENT_EXPORT extern const base::Feature kMacV2Sandbox;
#endif // defined(OS_MACOSX) #endif // defined(OS_MACOSX)
......
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