Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fe4af8b17fb6e12697825b46a8c0a542a7a7525a
      
https://github.com/WebKit/WebKit/commit/fe4af8b17fb6e12697825b46a8c0a542a7a7525a
  Author: Brent Fulgham <bfulg...@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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to