RESOLVED FIXED Bug 164057
WebRTC: RTCPeerConnection constructor argument should be optional
https://bugs.webkit.org/show_bug.cgi?id=164057
Summary WebRTC: RTCPeerConnection constructor argument should be optional
Nael Ouedraogo
Reported 2016-10-27 03:21:45 PDT
RTCPeerConnection constructor argument should be optional.
Attachments
Patch (5.33 KB, patch)
2016-10-27 03:35 PDT, Nael Ouedraogo
no flags
Patch (8.19 KB, patch)
2016-12-19 07:06 PST, Nael Ouedraogo
no flags
Patch (8.13 KB, patch)
2016-12-19 10:04 PST, Nael Ouedraogo
no flags
Nael Ouedraogo
Comment 1 2016-10-27 03:35:34 PDT
youenn fablet
Comment 2 2016-10-27 05:04:24 PDT
Comment on attachment 293010 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=293010&action=review > Source/WebCore/Modules/mediastream/RTCPeerConnection.js:43 > + this.@initializeWith(configuration); I think we may need to call @initializeWith even if configuration is undefined. In that case, we might need to pass an empty dictionary. Or we could pass a dictionary with the default values if we want to handle defaults here. Probably simpler to just pass an empty object.
youenn fablet
Comment 3 2016-10-27 05:10:36 PDT
Also, some of the newly imported tests in LayoutTests/imported/w3c/web-platform-tests/webrtc might cover these changes. Might want to activate some of them
youenn fablet
Comment 4 2016-10-27 05:24:19 PDT
(In reply to comment #2) > Comment on attachment 293010 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=293010&action=review > > > Source/WebCore/Modules/mediastream/RTCPeerConnection.js:43 > > + this.@initializeWith(configuration); > > I think we may need to call @initializeWith even if configuration is > undefined. > In that case, we might need to pass an empty dictionary. > Or we could pass a dictionary with the default values if we want to handle > defaults here. > Probably simpler to just pass an empty object. If we do not need to call @initializeWith, it might be best to rename this function to something like @setConfiguration.
Adam Bergkvist
Comment 5 2016-10-27 06:38:37 PDT
(A side note.) A lot of tests have a dummy configuration used to construct RTCPeerConnection since the argument wasn't optional. We might want to clean that up.
youenn fablet
Comment 6 2016-10-27 06:47:13 PDT
(In reply to comment #5) > (A side note.) A lot of tests have a dummy configuration used to construct > RTCPeerConnection since the argument wasn't optional. We might want to clean > that up. OK, it might be safer then to make the call to @initializeWith mandatory for now and pass it a { } if parameter is undefined. Refactoring to make it optional sounds good as a follow-up.
youenn fablet
Comment 7 2016-10-27 07:05:48 PDT
Related test LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor.html seems to expect that a null parameter should not throw.
Nael Ouedraogo
Comment 8 2016-12-19 07:06:41 PST
youenn fablet
Comment 9 2016-12-19 07:21:57 PST
Comment on attachment 297458 [details] Patch LGTM. View in context: https://bugs.webkit.org/attachment.cgi?id=297458&action=review > Source/WebCore/Modules/mediastream/RTCPeerConnection.js:40 > if (!@isObject(configuration)) You could add "else if" here > LayoutTests/fast/mediastream/RTCPeerConnection.html:12 > + shouldNotThrow("new RTCPeerConnection();"); Maybe we can remove those two tests since they are not providing more than what the wpt tests provide already?
Nael Ouedraogo
Comment 10 2016-12-19 09:06:43 PST
Thanks for the review and comments. > > Source/WebCore/Modules/mediastream/RTCPeerConnection.js:40 > > if (!@isObject(configuration)) > > You could add "else if" here Ok I will upload a new patch. > > LayoutTests/fast/mediastream/RTCPeerConnection.html:12 > > + shouldNotThrow("new RTCPeerConnection();"); > > Maybe we can remove those two tests since they are not providing more than > what the wpt tests provide already? Ok.
Nael Ouedraogo
Comment 11 2016-12-19 09:15:54 PST
(In reply to comment #7) > Related test > LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/ > rtcpeerconnection-constructor.html seems to expect that a null parameter > should not throw. I think it should throw as per specification (https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection).
youenn fablet
Comment 12 2016-12-19 09:48:01 PST
(In reply to comment #11) > (In reply to comment #7) > > Related test > > LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/ > > rtcpeerconnection-constructor.html seems to expect that a null parameter > > should not throw. > I think it should throw as per specification > (https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection). Right, I think chromium and firefox accept null parameters currently, while webkit does not. We should try to converge on that issue.
Nael Ouedraogo
Comment 13 2016-12-19 10:04:49 PST
Nael Ouedraogo
Comment 14 2016-12-20 02:12:01 PST
Thanks for the review!
WebKit Commit Bot
Comment 15 2016-12-20 02:25:20 PST
Comment on attachment 297463 [details] Patch Clearing flags on attachment: 297463 Committed r210017: <http://trac.webkit.org/changeset/210017>
WebKit Commit Bot
Comment 16 2016-12-20 02:25:24 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.