Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick fe4af8b. rdar://problem/109380900
Cherry-pick 264460@main (fe4af8b). <rdar://109380900> [Cocoa] Call [AVCaptureDevice ensureServerConnection] when new extensions are made to the GPU Process https://bugs.webkit.org/show_bug.cgi?id=257241 <rdar://109380900> Reviewed by Eric Carlson. Our current code only calls [AVCaptureDevice ensureServerConnection] the first time we extend the sandbox. This can lead to problems if the user visits a site that only needs Microphone access (for example), and then visits a site that needs Camera access. Because the camera-related extensions are only recognized by the video capture system when [AVCaptureDevice ensureServiceConnection] is called, the fact that we called it before the new sandbox extensions were in place mean we never activate the relevant features. To fix this, we should simply call [AVCaptureDevice ensureServerConnection] any time we extend the sandbox. I have confirmed with the relevant teams that this call is low-cost (performance wise), and is not harmful to call repeatedly for things that have already been activated. This patch also adds new logging to help debug similar problems in the future. * Source/WebKit/GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::updateSandboxAccess): Add logging. (WebKit::GPUProcess::updateCaptureAccess): Ditto. * Source/WebKit/GPUProcess/cocoa/GPUProcessCocoa.mm: (WebKit::GPUProcess::ensureAVCaptureServerConnection): Add new logging, no longer make this a 'std::call_once'. Canonical link: https://commits.webkit.org/264460@main Identifier: 263769.67@safari-7616.1.14.11-branch
- Loading branch information