RESOLVED FIXED 172200
iOS WebRTC Media Capture should not allow camera capture from background tab
https://bugs.webkit.org/show_bug.cgi?id=172200
Summary iOS WebRTC Media Capture should not allow camera capture from background tab
youenn fablet
Reported 2017-05-16 16:55:31 PDT
iOS WebRTC Media Capture should not allow camera capture from background tab
Attachments
Patch (11.78 KB, patch)
2017-05-16 17:15 PDT, youenn fablet
no flags
Patch (12.08 KB, patch)
2017-05-16 21:03 PDT, youenn fablet
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (919.81 KB, application/zip)
2017-05-16 22:48 PDT, Build Bot
no flags
Archive of layout-test-results from ews100 for mac-elcapitan (1.17 MB, application/zip)
2017-05-17 05:15 PDT, Build Bot
no flags
Patch for landing (17.55 KB, patch)
2017-05-17 08:52 PDT, youenn fablet
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (14.17 MB, application/zip)
2017-05-17 10:50 PDT, Build Bot
no flags
Patch for landing (10.50 KB, patch)
2017-05-17 12:46 PDT, youenn fablet
no flags
Patch (3.03 KB, patch)
2017-06-01 09:05 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2017-05-16 16:55:46 PDT
radar 32199028
youenn fablet
Comment 2 2017-05-16 17:01:19 PDT
youenn fablet
Comment 3 2017-05-16 17:15:40 PDT
youenn fablet
Comment 4 2017-05-16 21:03:43 PDT
Build Bot
Comment 5 2017-05-16 22:48:30 PDT
Comment on attachment 310348 [details] Patch Attachment 310348 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3757145 New failing tests: platform/ios/mediastream/getUserMedia-disabled-in-background-tabs.html
Build Bot
Comment 6 2017-05-16 22:48:31 PDT
Created attachment 310351 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 7 2017-05-17 05:15:25 PDT
Comment on attachment 310348 [details] Patch Attachment 310348 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3761981 New failing tests: http/tests/media/hls/video-controls-live-stream.html
Build Bot
Comment 8 2017-05-17 05:15:26 PDT
Created attachment 310382 [details] Archive of layout-test-results from ews100 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Eric Carlson
Comment 9 2017-05-17 08:20:32 PDT
Comment on attachment 310348 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310348&action=review > Source/WebCore/ChangeLog:11 > + On iOS, muting/unmuting the current video source according Document visibility. Nit: "muting/unmuting" => "mute/unmute", "according" => "according to" > Source/WebCore/dom/Document.cpp:6991 > +void Document::notifyVisibilityChangedToMediaCapture() > +{ > +#if ENABLE(MEDIA_STREAM) > + RealtimeMediaSourceCenter::singleton().setVisibility(!hidden()); > +#endif > +} Nit: why is it necessary to put this one line call into a separate method?
Eric Carlson
Comment 10 2017-05-17 08:52:33 PDT
Comment on attachment 310348 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310348&action=review > LayoutTests/platform/ios/mediastream/getUserMedia-disabled-in-background-tabs.html:19 > + let audioTrack = firstStream.getAudioTracks()[0]; > + let videoTrack = firstStream.getVideoTracks()[0]; Where is firstStream set?
youenn fablet
Comment 11 2017-05-17 08:52:52 PDT
Created attachment 310394 [details] Patch for landing
youenn fablet
Comment 12 2017-05-17 09:06:19 PDT
(In reply to Eric Carlson from comment #9) > Comment on attachment 310348 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=310348&action=review > > > Source/WebCore/ChangeLog:11 > > + On iOS, muting/unmuting the current video source according Document visibility. > > Nit: "muting/unmuting" => "mute/unmute", "according" => "according to" > > > Source/WebCore/dom/Document.cpp:6991 > > +void Document::notifyVisibilityChangedToMediaCapture() > > +{ > > +#if ENABLE(MEDIA_STREAM) > > + RealtimeMediaSourceCenter::singleton().setVisibility(!hidden()); > > +#endif > > +} > > Nit: why is it necessary to put this one line call into a separate method? I did not want to pollute Document::visibilityStateChanged with too specific stuff. That is why I went this way. I can go back and inline it directly though. (In reply to Eric Carlson from comment #10) > Comment on attachment 310348 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=310348&action=review > > > LayoutTests/platform/ios/mediastream/getUserMedia-disabled-in-background-tabs.html:19 > > + let audioTrack = firstStream.getAudioTracks()[0]; > > + let videoTrack = firstStream.getVideoTracks()[0]; > > Where is firstStream set? Fixed in the uploaded patch, I'll make sure it passes on the iOS simulator bot before committing the change. Patch works on the device (manual testing)
Build Bot
Comment 13 2017-05-17 10:50:35 PDT
Comment on attachment 310394 [details] Patch for landing Attachment 310394 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3763551 New failing tests: platform/ios/mediastream/getUserMedia-disabled-in-background-tabs.html
Build Bot
Comment 14 2017-05-17 10:50:37 PDT
Created attachment 310410 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
youenn fablet
Comment 15 2017-05-17 12:46:49 PDT
Created attachment 310429 [details] Patch for landing
youenn fablet
Comment 16 2017-05-17 13:27:56 PDT
Let's land it as is so that we have the correct behavior in the regular case. And let's fix the more infrequent case of fullscreen mode (where camera should not be stopped) on a follow-up
WebKit Commit Bot
Comment 17 2017-05-17 14:08:29 PDT
Comment on attachment 310429 [details] Patch for landing Clearing flags on attachment: 310429 Committed r216999: <http://trac.webkit.org/changeset/216999>
WebKit Commit Bot
Comment 18 2017-05-17 14:08:31 PDT
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 19 2017-05-17 15:24:17 PDT
(In reply to WebKit Commit Bot from comment #17) > Comment on attachment 310429 [details] > Patch for landing > > Clearing flags on attachment: 310429 > > Committed r216999: <http://trac.webkit.org/changeset/216999> This change broke the Windows build: https://build.webkit.org/builders/Apple%20Win%20Release%20%28Build%29/builds/1574 WebCoreTestSupport.lib(JSInternals.obj) : error LNK2019: unresolved external symbol "public: void __thiscall WebCore::Internals::setPageVisibility(bool)" (?setPageVisibility@Internals@WebCore@@QAEX_N@Z) referenced in function "__int64 __cdecl WebCore::jsInternalsPrototypeFunctionSetPageVisibilityCaller(class JSC::ExecState *,class WebCore::JSInternals *,class JSC::ThrowScope &)" (?jsInternalsPrototypeFunctionSetPageVisibilityCaller@WebCore@@YA_JPAVExecState@JSC@@PAVJSInternals@1@AAVThrowScope@3@@Z) [C:\cygwin\home\buildbot\slave\win-release\build\WebKitBuild\Release\Tools\DumpRenderTree\DumpRenderTreeLib.vcxproj]
youenn fablet
Comment 20 2017-05-17 19:18:21 PDT
Thanks Ryan, I'll fix it asap (In reply to Ryan Haddad from comment #19) > (In reply to WebKit Commit Bot from comment #17) > > Comment on attachment 310429 [details] > > Patch for landing > > > > Clearing flags on attachment: 310429 > > > > Committed r216999: <http://trac.webkit.org/changeset/216999> > > This change broke the Windows build: > https://build.webkit.org/builders/Apple%20Win%20Release%20%28Build%29/builds/ > 1574 > > WebCoreTestSupport.lib(JSInternals.obj) : error LNK2019: unresolved external > symbol "public: void __thiscall WebCore::Internals::setPageVisibility(bool)" > (?setPageVisibility@Internals@WebCore@@QAEX_N@Z) referenced in function > "__int64 __cdecl > WebCore::jsInternalsPrototypeFunctionSetPageVisibilityCaller(class > JSC::ExecState *,class WebCore::JSInternals *,class JSC::ThrowScope &)" > (?jsInternalsPrototypeFunctionSetPageVisibilityCaller@WebCore@@YA_JPAVExecSta > te@JSC@@PAVJSInternals@1@AAVThrowScope@3@@Z) > [C:\cygwin\home\buildbot\slave\win- > release\build\WebKitBuild\Release\Tools\DumpRenderTree\DumpRenderTreeLib. > vcxproj]
youenn fablet
Comment 21 2017-05-17 19:24:09 PDT
youenn fablet
Comment 22 2017-06-01 09:05:24 PDT
Reopening to attach new patch.
youenn fablet
Comment 23 2017-06-01 09:05:24 PDT
youenn fablet
Comment 24 2017-06-02 16:05:03 PDT
Test was improved as part of bug 172858.
Note You need to log in before you can comment on or make changes to this bug.