macOS: Create a CFRunLoop for video-capture and audio services (issue #2573)

This commit is contained in:
Chris Dziemborowicz 2019-01-18 16:47:03 +00:00 committed by Marshall Greenblatt
parent 7ecc5d31ea
commit e94b3e2478
2 changed files with 21 additions and 0 deletions

View File

@ -113,6 +113,11 @@
#include "content/public/common/content_descriptors.h"
#endif
#if defined(OS_MACOSX)
#include "services/audio/public/mojom/constants.mojom.h"
#include "services/video_capture/public/mojom/constants.mojom.h"
#endif
#if defined(OS_WIN)
#include "sandbox/win/src/sandbox_policy.h"
#endif
@ -776,6 +781,19 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
}
}
void CefContentBrowserClient::AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity,
base::CommandLine* command_line) {
#if defined(OS_MACOSX)
// On Mac, the video-capture and audio services require a CFRunLoop, provided
// by a UI message loop, to run AVFoundation and CoreAudio code.
// See https://crbug.com/834581
if (identity.name() == video_capture::mojom::kServiceName ||
identity.name() == audio::mojom::kServiceName)
command_line->AppendSwitch(switches::kMessageLoopTypeUi);
#endif
}
bool CefContentBrowserClient::ShouldEnableStrictSiteIsolation() {
// TODO(cef): Enable this mode once we figure out why it breaks ceftests that
// rely on command-line arguments passed to the renderer process. It looks

View File

@ -61,6 +61,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::BrowserContext* context2) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
int child_process_id) override;
void AdjustUtilityServiceProcessCommandLine(
const service_manager::Identity& identity,
base::CommandLine* command_line) override;
bool ShouldEnableStrictSiteIsolation() override;
std::string GetApplicationLocale() override;
content::QuotaPermissionContext* CreateQuotaPermissionContext() override;