Disable media capture if an app's entitlements won't allow access to capture devices
<rdar://problem/69956112>
Created attachment 410528 [details] Patch
Comment on attachment 410528 [details] 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 > -@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.
Created attachment 410561 [details] Patch for landing
Created attachment 410565 [details] Patch for landing
Comment on attachment 410565 [details] Patch for landing The Windows test failures are unrelated
Committed r268012: <https://trac.webkit.org/changeset/268012> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410565 [details].
Comment on attachment 410565 [details] Patch for landing Not a big fan of the word "random" in those usage messages, but I guess it’s just MiniBrowser. I would have probably written "Recording videos on behalf of websites"
(In reply to Darin Adler from comment #8) > Comment on attachment 410565 [details] > Patch for landing > > Not a big fan of the word "random" in those usage messages, but I guess it’s > just MiniBrowser. I would have probably written "Recording videos on behalf > of websites" Good point, I'll fix that in a followup.
Reopening to attach new patch.
Created attachment 410594 [details] Fix usage strings
Committed r268023: <https://trac.webkit.org/changeset/268023> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410594 [details].