Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ccf6f3b2a35010f3959e1a8d4b2353d70367d14
      
https://github.com/WebKit/WebKit/commit/9ccf6f3b2a35010f3959e1a8d4b2353d70367d14
  Author: Eric Carlson <[email protected]>
  Date:   2026-05-02 (Sat, 02 May 2026)

  Changed paths:
    M Source/WebCore/page/MediaProducer.h
    M Source/WebCore/page/MediaProducer.serialization.in
    M Source/WebKit/UIProcess/Cocoa/UserMediaPermissionRequestProxyCocoa.mm
    M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h

  Log Message:
  -----------
  [Cocoa] Activate DisplayCaptureCapability before prompting for getDisplayMedia
https://bugs.webkit.org/show_bug.cgi?id=313843
rdar://176044721

Reviewed by Jer Noble.

Activate the display capture endowment while a getDisplayMedia() permission 
prompt is pending.

Track whether a getDisplayMedia() prompt is in progress with two new 
MediaProducerMediaState
bits: IsPromptingForWindowCapture and IsPromptingForScreenCapture. Include 
these bits in
the display capture capability activation/deactivation checks so the endowment 
is held for
the full duration of the prompt, not just once capture begins. Clear the 
prompting state
on denial, cancellation, and page invalidation, preserve it across transient 
media state
updates until DisplayCaptureMask is set.

Tested manually.

* Source/WebCore/page/MediaProducer.h:
* Source/WebCore/page/MediaProducer.serialization.in:
* Source/WebKit/UIProcess/Cocoa/UserMediaPermissionRequestProxyCocoa.mm:
(WebKit::UserMediaPermissionRequestProxyCocoa::invalidate):
(WebKit::UserMediaPermissionRequestProxyCocoa::promptForGetDisplayMedia):
* Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::shouldActivateDisplayCaptureCapability const):
(WebKit::WebPageProxy::shouldDeactivateDisplayCaptureCapability const):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIsPromptingForGetDisplayMedia):
(WebKit::WebPageProxy::isPlayingMediaDidChange):
* Source/WebKit/UIProcess/WebPageProxy.h:

Canonical link: https://commits.webkit.org/312477@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to