0
Files
src/content/browser/video_capture_service_impl.h
Florent Castelli 8764dd4512 Introduce a safe-mode for the VideoCapture Service
On macOS, this disables loading 3rd-party DAL plugins, which may
crash upon use.
This relies on the hardened runtime from signed binaries.
When the CHILD_PLUGIN option is passed, the runtime is disabled and
3rd-party DAL plugins are allowed.
For developers convenience who cannot sign their binaries,
an environment variable was identified within the the macOS libraries
to achieve a similar effect and skip loading all DAL plugins.

This is enabled by the RetryGetVideoCaptureDeviceInfos feature which
is also updated accordingly.

The feature can now handle a service crash properly and is compiled
on all platforms, though only macOS will have at most one retry.
On the second attempt, the VideoCaptureService safe-mode will be
enabled.

Traces of the old RetryCount are removed since the value is unused.

Bug: 990381
Change-Id: If042b19006ef4166260941af5485897f65e5e0de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4209899
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Florent Castelli <orphis@chromium.org>
Reviewed-by: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: Tony Herre <toprice@chromium.org>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1103243}
2023-02-09 13:43:30 +00:00

21 lines
690 B
C++

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_VIDEO_CAPTURE_SERVICE_IMPL_H_
#define CONTENT_BROWSER_VIDEO_CAPTURE_SERVICE_IMPL_H_
#include "content/common/content_export.h"
#include "services/video_capture/public/mojom/video_capture_service.mojom-forward.h"
namespace content {
// Enables a safe-mode VideoCaptureService.
// On macOS, this disables 3rd-party DAL plugins from being loaded.
// It currently has no effect on other platforms.
void EnableVideoCaptureServiceSafeMode();
} // namespace content
#endif // CONTENT_BROWSER_VIDEO_CAPTURE_SERVICE_IMPL_H_