Bug 257241 - [Cocoa] Call [AVCaptureDevice ensureServerConnection] when new extensions are made to the GPU Process
Summary: [Cocoa] Call [AVCaptureDevice ensureServerConnection] when new extensions are...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-05-23 16:47 PDT by Brent Fulgham
Modified: 2023-05-23 23:06 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2023-05-23 16:47:12 PDT
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.
Comment 1 Brent Fulgham 2023-05-23 16:47:38 PDT
<rdar://109380900>
Comment 2 Brent Fulgham 2023-05-23 17:04:31 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14276
Comment 3 EWS 2023-05-23 23:06:56 PDT
Committed 264460@main (fe4af8b17fb6): <https://commits.webkit.org/264460@main>

Reviewed commits have been landed. Closing PR #14276 and removing active labels.