[webkit-reviews] review granted: [Bug 217319] Disable media capture if an app's entitlements won't allow access to capture devices : [Attachment 410528] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 5 10:45:48 PDT 2020


youenn fablet <youennf at gmail.com> has granted Eric Carlson
<eric.carlson at apple.com>'s request for review:
Bug 217319: Disable media capture if an app's entitlements won't allow access
to capture devices
https://bugs.webkit.org/show_bug.cgi?id=217319

Attachment 410528: Patch

https://bugs.webkit.org/attachment.cgi?id=410528&action=review




--- Comment #3 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 410528
  --> https://bugs.webkit.org/attachment.cgi?id=410528
Patch

I think we can keep the patch much smaller by keeping _mediaCaptureEnabled.
WKWebViewConfiguration._mediaCaptureEnabled is better than
WKPReferences._mediaDevicesEnabled as we want a page to have a consistent
exposure of getUserMedia throughout its lifetime.
Also, not removing it will make the patch much smaller :)

View in context: https://bugs.webkit.org/attachment.cgi?id=410528&action=review

> Source/WebCore/page/SettingsBase.cpp:343
> +	   m_page->settings().setMediaDevicesEnabled(true);

mock capture devices can be changed during the lifetime of the page.
MediaDevicesEnabled should be set once and for all for the page so, it might be
better to have two toggles for now.
If we really want to have just one toggle, we should compute it in UIProcess.

> Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:-123
> - at property (nonatomic, setter=_setMediaCaptureEnabled:) BOOL
_mediaCaptureEnabled WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));

Why removing this one?
This does not seem necessary for this patch and we should instead be removing
_mediaDevicesEnabled from being exposed in WebPreferences.


More information about the webkit-reviews mailing list