Bug 192511 - [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
Summary: [MediaStream] 'devicechange' event should not fire in frames that can't acces...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-12-07 12:43 PST by Eric Carlson
Modified: 2018-12-07 19:11 PST (History)
5 users (show)

See Also:


Attachments
Patch (22.18 KB, patch)
2018-12-07 13:26 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.59 MB, application/zip)
2018-12-07 14:21 PST, EWS Watchlist
no flags Details
Patch for landing. (32.00 KB, patch)
2018-12-07 16:54 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2018-12-07 12:43:53 PST
A 'devicechange' event should not be fired in an iframe unless it has access to capture devices.
Comment 1 Radar WebKit Bug Importer 2018-12-07 12:44:08 PST
<rdar://problem/46562063>
Comment 2 Eric Carlson 2018-12-07 13:26:03 PST
Created attachment 356832 [details]
Patch
Comment 3 youenn fablet 2018-12-07 13:49:39 PST
Comment on attachment 356832 [details]
Patch

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

> Source/WebKit/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:103
> +        auto accessState = originHasPersistentAccess ? DeviceAccessState::PersistentAccess : DeviceAccessState::SessionAccess;

Do we need to send that information any longer?
It seems that just knowing that we have access is good enough now.

> LayoutTests/http/tests/media/media-stream/device-change-event-in-iframe.html:6
> +    <iframe id="camera" allow="camera" src="http://localhost:8000/media/media-stream/resources/device-change-iframe.html?2"></iframe>

For the sake of completeness, I would tend to add a frame with an allow="microphone" as well.
Comment 4 EWS Watchlist 2018-12-07 14:21:01 PST
Comment on attachment 356832 [details]
Patch

Attachment 356832 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/10308982

New failing tests:
http/tests/media/media-stream/device-change-event-in-iframe.html
Comment 5 EWS Watchlist 2018-12-07 14:21:02 PST
Created attachment 356836 [details]
Archive of layout-test-results from ews107 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 6 Eric Carlson 2018-12-07 16:54:41 PST
Created attachment 356854 [details]
Patch for landing.
Comment 7 WebKit Commit Bot 2018-12-07 19:11:44 PST
Comment on attachment 356854 [details]
Patch for landing.

Clearing flags on attachment: 356854

Committed r239006: <https://trac.webkit.org/changeset/239006>
Comment 8 WebKit Commit Bot 2018-12-07 19:11:45 PST
All reviewed patches have been landed.  Closing bug.