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.
<rdar://109380900>
Pull request: https://github.com/WebKit/WebKit/pull/14276
Committed 264460@main (fe4af8b17fb6): <https://commits.webkit.org/264460@main> Reviewed commits have been landed. Closing PR #14276 and removing active labels.