Commit 1a291743 authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

Set the main thread of the audio process as type UI on Mac

This ensures that the main thread as a CFRunLoop, which is required
by audio APIs on Mac.

Bug: 841845
Change-Id: I10be74d77c1585014a63896099eb2b4acb5b345b
Reviewed-on: https://chromium-review.googlesource.com/1054227
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Olga Sharonova <olka@chromium.org>
Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557597}
parent d8f72fd2
...@@ -276,6 +276,7 @@ ...@@ -276,6 +276,7 @@
#include "sandbox/win/src/sandbox_policy.h" #include "sandbox/win/src/sandbox_policy.h"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#include "chrome/browser/chrome_browser_main_mac.h" #include "chrome/browser/chrome_browser_main_mac.h"
#include "services/audio/public/mojom/constants.mojom.h"
#include "services/video_capture/public/mojom/constants.mojom.h" #include "services/video_capture/public/mojom/constants.mojom.h"
#elif defined(OS_CHROMEOS) #elif defined(OS_CHROMEOS)
#include "ash/public/interfaces/constants.mojom.h" #include "ash/public/interfaces/constants.mojom.h"
...@@ -2099,9 +2100,11 @@ void ChromeContentBrowserClient::AdjustUtilityServiceProcessCommandLine( ...@@ -2099,9 +2100,11 @@ void ChromeContentBrowserClient::AdjustUtilityServiceProcessCommandLine(
#endif // BUILDFLAG(ENABLE_MUS) #endif // BUILDFLAG(ENABLE_MUS)
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// On Mac, the video-capture service requires a CFRunLoop, provided by a UI // On Mac, the video-capture and audio services require a CFRunLoop, provided
// message loop, to run AVFoundation code. See https://crbug.com/834581 // by a UI message loop, to run AVFoundation and CoreAudio code.
if (identity.name() == video_capture::mojom::kServiceName) // See https://crbug.com/834581
if (identity.name() == video_capture::mojom::kServiceName ||
identity.name() == audio::mojom::kServiceName)
command_line->AppendSwitch(switches::kMessageLoopTypeUi); command_line->AppendSwitch(switches::kMessageLoopTypeUi);
#endif #endif
} }
......
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