Bug 167992 - RTCPeerConnection constructor can take null as input
Summary: RTCPeerConnection constructor can take null as input
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-08 08:19 PST by youenn fablet
Modified: 2017-02-08 10:56 PST (History)
4 users (show)

See Also:


Attachments
Patch (22.76 KB, patch)
2017-02-08 08:23 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-elcapitan (857.49 KB, application/zip)
2017-02-08 09:06 PST, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1008.29 KB, application/zip)
2017-02-08 09:07 PST, Build Bot
no flags Details
Patch (22.49 KB, patch)
2017-02-08 09:11 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (22.62 KB, patch)
2017-02-08 10:42 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-02-08 08:19:27 PST
RTCPeerConnection constructor can take null as input
Comment 1 youenn fablet 2017-02-08 08:23:42 PST
Created attachment 300899 [details]
Patch
Comment 2 Sam Weinig 2017-02-08 09:05:37 PST
Comment on attachment 300899 [details]
Patch

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

> Source/WebCore/Modules/mediastream/RTCPeerConnection.js:37
> +    if (configuration === @undefined || configuration === null)

Could you remove this check (and the isObject check, and just make initializeWith take an optional RTCConfiguration?
Comment 3 Build Bot 2017-02-08 09:06:32 PST
Comment on attachment 300899 [details]
Patch

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

New failing tests:
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
Comment 4 Build Bot 2017-02-08 09:06:35 PST
Created attachment 300909 [details]
Archive of layout-test-results from ews102 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 5 Build Bot 2017-02-08 09:07:40 PST
Comment on attachment 300899 [details]
Patch

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

New failing tests:
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
Comment 6 Build Bot 2017-02-08 09:07:43 PST
Created attachment 300910 [details]
Archive of layout-test-results from ews105 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 7 youenn fablet 2017-02-08 09:11:19 PST
Created attachment 300911 [details]
Patch
Comment 8 Chris Dumez 2017-02-08 09:24:28 PST
Comment on attachment 300911 [details]
Patch

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

r=me with comments.

> Source/WebCore/ChangeLog:8
> +        Covered by updated test.

Let's point to the following specs in the Changelog:
- https://heycam.github.io/webidl/#es-dictionary
- https://www.w3.org/TR/webrtc/#interface-definition

> Source/WebCore/Modules/mediastream/RTCPeerConnection.js:37
> +    if (configuration === @undefined || configuration === null)

Do we want to do configuration == null instead?

> LayoutTests/fast/mediastream/RTCPeerConnection.html:10
> +            shouldNotThrow("new RTCPeerConnection(null);");

Would be good to test that we end up using the default members values as well.
Comment 9 Chris Dumez 2017-02-08 09:43:13 PST
Comment on attachment 300911 [details]
Patch

Please see my comments.
Comment 10 youenn fablet 2017-02-08 10:38:23 PST
> > Source/WebCore/ChangeLog:8
> > +        Covered by updated test.
> 
> Let's point to the following specs in the Changelog:
> - https://heycam.github.io/webidl/#es-dictionary
> - https://www.w3.org/TR/webrtc/#interface-definition

OK

> > Source/WebCore/Modules/mediastream/RTCPeerConnection.js:37
> > +    if (configuration === @undefined || configuration === null)
> 
> Do we want to do configuration == null instead?

Sure, this is equivalent.

> > LayoutTests/fast/mediastream/RTCPeerConnection.html:10
> > +            shouldNotThrow("new RTCPeerConnection(null);");
> 
> Would be good to test that we end up using the default members values as
> well.

Right, let's do that in a follow-up patch.
Comment 11 youenn fablet 2017-02-08 10:42:07 PST
(In reply to comment #2)
> Comment on attachment 300899 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=300899&action=review
> 
> > Source/WebCore/Modules/mediastream/RTCPeerConnection.js:37
> > +    if (configuration === @undefined || configuration === null)
> 
> Could you remove this check (and the isObject check, and just make
> initializeWith take an optional RTCConfiguration?

We would need the binding generator to do the argument checking.
Currently, that handling is left to the JS built-in code.
Comment 12 youenn fablet 2017-02-08 10:42:15 PST
Created attachment 300922 [details]
Patch for landing
Comment 13 WebKit Commit Bot 2017-02-08 10:56:28 PST
Comment on attachment 300922 [details]
Patch for landing

Clearing flags on attachment: 300922

Committed r211886: <http://trac.webkit.org/changeset/211886>
Comment 14 WebKit Commit Bot 2017-02-08 10:56:34 PST
All reviewed patches have been landed.  Closing bug.