[webkit-changes] [WebKit/WebKit] fe4af8: [Cocoa] Call [AVCaptureDevice ensureServerConnecti...

Brent Fulgham noreply at github.com
Tue May 23 23:07:06 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fe4af8b17fb6e12697825b46a8c0a542a7a7525a
      https://github.com/WebKit/WebKit/commit/fe4af8b17fb6e12697825b46a8c0a542a7a7525a
  Author: Brent Fulgham <bfulgham at apple.com>
  Date:   2023-05-23 (Tue, 23 May 2023)

  Changed paths:
    M Source/WebKit/GPUProcess/GPUProcess.cpp
    M Source/WebKit/GPUProcess/cocoa/GPUProcessCocoa.mm

  Log Message:
  -----------
  [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




More information about the webkit-changes mailing list