Bug 165251 - Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
Summary: Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords:
Depends on:
Blocks: 166346
  Show dependency treegraph
 
Reported: 2016-12-01 04:42 PST by Alex. Gouaillard
Modified: 2016-12-21 10:46 PST (History)
12 users (show)

See Also:


Attachments
Patch (7.26 KB, patch)
2016-12-02 02:16 PST, Alex. Gouaillard
no flags Details | Formatted Diff | Diff
Patch (8.29 KB, patch)
2016-12-02 10:48 PST, Alex. Gouaillard
no flags Details | Formatted Diff | Diff
Patch (8.45 KB, patch)
2016-12-02 11:09 PST, Alex. Gouaillard
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-yosemite (1.58 MB, application/zip)
2016-12-02 12:25 PST, Build Bot
no flags Details
Archive of layout-test-results from ews103 for mac-yosemite (949.25 KB, application/zip)
2016-12-02 12:26 PST, Build Bot
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (deleted)
2016-12-02 12:44 PST, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (1.67 MB, application/zip)
2016-12-02 12:46 PST, Build Bot
no flags Details
Updated patch. (25.07 KB, patch)
2016-12-09 15:19 PST, Eric Carlson
dino: review+
Details | Formatted Diff | Diff
Patch for landing. (25.42 KB, patch)
2016-12-09 18:14 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Updated to fix broken API test. (4.85 KB, patch)
2016-12-13 07:35 PST, Eric Carlson
youennf: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex. Gouaillard 2016-12-01 04:42:06 PST
It has been brought to my attention that apparently Safari Tech Preview Release 18 (Safari 10.1, WebKit 12603.1.12) is exposing RTCPeerConnection and navigator.mediaDevices.getUserMedia.

Since a check for
   navigator.mediaDevices.getUserMedia && window.RTCPeerConnection
and redirecting browsers that support neither is pretty common this is rather unfortunate.

The getUserMedia implementation does not seems to work on one of the most basic GUM samples at
    https://webrtc.github.io/samples/src/content/getusermedia/gum/
I am actually not seeing GUM resolve or reject the promise at all.

And RTCPeerConnection did not work either in
    https://webrtc.github.io/samples/src/content/peerconnection/pc1/

What is the plan here?

Philipp
Comment 1 Alex. Gouaillard 2016-12-01 04:43:52 PST
I think we should add runtime flags for getUserMedia and RTCPeerConnection and set them to off in Safari Tech Preview until stable enough.

Then we might just need to make the related IDLs exposed according that flag through EnabledAtRuntime keyword.
Comment 2 Philippe Normand 2016-12-01 05:14:25 PST
There's a Setting already for gUM, AFAIK.
Comment 3 Philippe Normand 2016-12-01 05:16:21 PST
(In reply to comment #2)
> There's a Setting already for gUM, AFAIK.

For the GTK port only though :)
Comment 4 youenn fablet 2016-12-01 05:38:00 PST
You might want to consider the following IDLs:

Source/WebCore/Modules/mediastream/MediaStreamEvent.idl
Source/WebCore/Modules/mediastream/NavigatorMediaDevices.idl
Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl
Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.idl
Source/WebCore/Modules/mediastream/RTCIceCandidate.idl
Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
Source/WebCore/Modules/mediastream/RTCRtpReceiver.idl
Source/WebCore/Modules/mediastream/RTCRtpSender.idl
Source/WebCore/Modules/mediastream/RTCRtpTransceiver.idl
Source/WebCore/Modules/mediastream/RTCSessionDescription.idl
Source/WebCore/Modules/mediastream/RTCTrackEvent.idl

You might also need to update CommonIdentifiers.h
Comment 6 Alex. Gouaillard 2016-12-01 05:59:52 PST
my bad, was in the list ....
waiting for webkit checkout ... i will never complain about chromium checkout time again ....
Comment 7 Alex. Gouaillard 2016-12-02 02:16:50 PST
Created attachment 295935 [details]
Patch
Comment 8 youenn fablet 2016-12-02 04:22:15 PST
Updating CommonIdentifiers.h should fix the build issue
Comment 9 youenn fablet 2016-12-02 04:24:31 PST
Comment on attachment 295935 [details]
Patch

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

> Source/WebCore/Modules/mediastream/RTCIceCandidate.idl:37
>      ImplementationLacksVTable,

You probable need to do something like EnabledAtRuntime=PeerConnection (or MediaStream) depending on the IDL.
Comment 10 Alex. Gouaillard 2016-12-02 04:26:31 PST
(In reply to comment #8)
> Updating CommonIdentifiers.h should fix the build issue

thanks for the comment. I took a look at the file (eventually the one in JavaScriptCore), however, I'm not sure what I am supposed to do there. Please educate me.
Comment 11 Alex. Gouaillard 2016-12-02 04:31:05 PST
Should I add some entries in generic/RuntimeEnabledFeatures.h instead?
Comment 12 youenn fablet 2016-12-02 04:35:28 PST
If you look at the generated code, it is searching for property names that are not defined (like XxEvent). You need to add them directly by hand in CommonIdentifiers.h. please have a look at other IDLs having EnabledAtRuntime.
You will see the name of these interfaces in CommonIdentifiers.h
We probably should have a better way to handle that in the future.
Comment 13 Alex. Gouaillard 2016-12-02 10:39:23 PST
ok, looked at IDBTransaction and I see the corresponding entry in the CommonIdentifiers.h.

I do not understand what the =InterfaceName is doing there though, and if I should add it for the RTC objects.

I will take care of the CommonIdentifiers additions first.
Comment 14 Chris Dumez 2016-12-02 10:44:07 PST
Comment on attachment 295935 [details]
Patch

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

> Source/WebCore/Modules/mediastream/MediaStreamEvent.idl:28
> +    EnabledAtRuntime,

It needs to be EnabledAtRuntime=Something

And Something needs to be defined in RuntimeEnabledFeatures.h
Comment 15 Chris Dumez 2016-12-02 10:45:11 PST
Comment on attachment 295935 [details]
Patch

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

>> Source/WebCore/Modules/mediastream/MediaStreamEvent.idl:28
>> +    EnabledAtRuntime,
> 
> It needs to be EnabledAtRuntime=Something
> 
> And Something needs to be defined in RuntimeEnabledFeatures.h

There is already one for MediaStream:
EnabledAtRuntime=MediaStream
Comment 16 Alex. Gouaillard 2016-12-02 10:48:58 PST
Created attachment 295964 [details]
Patch
Comment 17 Alex. Gouaillard 2016-12-02 10:58:24 PST
(In reply to comment #15)
> Comment on attachment 295935 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=295935&action=review
> 
> >> Source/WebCore/Modules/mediastream/MediaStreamEvent.idl:28
> >> +    EnabledAtRuntime,
> > 
> > It needs to be EnabledAtRuntime=Something
> > 
> > And Something needs to be defined in RuntimeEnabledFeatures.h
> 
> There is already one for MediaStream:
> EnabledAtRuntime=MediaStream

thanks.
understood. changes in the way.
Comment 18 Alex. Gouaillard 2016-12-02 11:09:45 PST
Created attachment 295965 [details]
Patch
Comment 19 Build Bot 2016-12-02 12:24:57 PST
Comment on attachment 295965 [details]
Patch

Attachment 295965 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2608563

New failing tests:
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
imported/w3c/web-platform-tests/webrtc/datachannel-emptystring.html
imported/w3c/web-platform-tests/webrtc/no-media-call.html
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor.html
imported/w3c/web-platform-tests/webrtc/promises-call.html
Comment 20 Build Bot 2016-12-02 12:25:01 PST
Created attachment 295977 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 21 Build Bot 2016-12-02 12:26:22 PST
Comment on attachment 295965 [details]
Patch

Attachment 295965 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2608607

New failing tests:
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
imported/w3c/web-platform-tests/webrtc/datachannel-emptystring.html
imported/w3c/web-platform-tests/webrtc/no-media-call.html
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor.html
imported/w3c/web-platform-tests/webrtc/promises-call.html
Comment 22 Build Bot 2016-12-02 12:26:27 PST
Created attachment 295978 [details]
Archive of layout-test-results from ews103 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 23 Build Bot 2016-12-02 12:43:54 PST
Comment on attachment 295965 [details]
Patch

Attachment 295965 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/2608610

New failing tests:
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
imported/w3c/web-platform-tests/webrtc/datachannel-emptystring.html
imported/w3c/web-platform-tests/webrtc/no-media-call.html
imported/w3c/web-platform-tests/webrtc/promises-call.html
http/tests/ssl/media-stream/get-user-media-nested.html
http/tests/ssl/media-stream/get-user-media-secure-connection.html
http/tests/ssl/media-stream/get-user-media-different-host.html
imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor.html
Comment 24 Build Bot 2016-12-02 12:44:00 PST
Created attachment 295983 [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
Comment 25 Build Bot 2016-12-02 12:45:56 PST
Comment on attachment 295965 [details]
Patch

Attachment 295965 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2608650

Number of test failures exceeded the failure limit.
Comment 26 Build Bot 2016-12-02 12:46:00 PST
Created attachment 295984 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 27 Philippe Normand 2016-12-04 23:55:53 PST
If this runtime flag is off by default then the test harness needs to turn it on, to avoid the test failures reported by the EWS.
Comment 28 Philippe Normand 2016-12-05 07:42:00 PST
See how it was done for SubtleCrypto, for instance, in bug #164982
Comment 29 Alex. Gouaillard 2016-12-05 07:45:19 PST
Thanks phil. I will address in 12 hours.
Comment 30 Eric Carlson 2016-12-09 15:19:54 PST
Created attachment 296718 [details]
Updated patch.
Comment 31 Alex. Gouaillard 2016-12-09 15:29:03 PST
Comment on attachment 296718 [details]
Updated patch.

thanks eric for pushing this through the finish line. I'm not sure I would have been able to find all the remaining needed modifications this week-end.
Comment 32 Dean Jackson 2016-12-09 15:49:06 PST
Comment on attachment 296718 [details]
Updated patch.

To make it easier for testing you might want to add support for the comment lines in DRT and WKTR.
Comment 33 Eric Carlson 2016-12-09 18:14:26 PST
Created attachment 296759 [details]
Patch for landing.
Comment 34 Eric Carlson 2016-12-09 18:40:14 PST
(In reply to comment #31)
> Comment on attachment 296718 [details]
> Updated patch.
> 
> thanks eric for pushing this through the finish line. I'm not sure I would
> have been able to find all the remaining needed modifications this week-end.

Thank you for getting things started!
Comment 35 WebKit Commit Bot 2016-12-09 18:47:02 PST
Comment on attachment 296759 [details]
Patch for landing.

Clearing flags on attachment: 296759

Committed r209643: <http://trac.webkit.org/changeset/209643>
Comment 36 Alexey Proskuryakov 2016-12-12 09:13:02 PST
This change appears to have made WebKit2.EnumerateDevices API test always time out.
Comment 37 Eric Carlson 2016-12-13 07:35:36 PST
Created attachment 297013 [details]
Updated to fix broken API test.
Comment 38 Eric Carlson 2016-12-13 09:02:01 PST
Committed rr209757: https://trac.webkit.org/r209757