From ec96d21e8706b9f90984b7cd3443a036cde60f6a Mon Sep 17 00:00:00 2001 From: Jan-Ivar Bruaroey Date: Tue, 8 Nov 2016 20:22:40 -0500 Subject: [PATCH] Bug 1263312 - Update RTCIceCandidate to spec. r=drno,smaug MozReview-Commit-ID: 6S60dAWgZH5 --HG-- extra : rebase_source : e2c5629b30e1227269a160609413d71769f5359f --- dom/media/PeerConnection.js | 8 ++------ dom/webidl/RTCIceCandidate.webidl | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index cf526fcea270..09217a59e164 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -229,9 +229,7 @@ GlobalPCList.prototype = { }; var _globalPCList = new GlobalPCList(); -function RTCIceCandidate() { - this.candidate = this.sdpMid = this.sdpMLineIndex = null; -} +function RTCIceCandidate() {} RTCIceCandidate.prototype = { classDescription: "RTCIceCandidate", classID: PC_ICE_CID, @@ -242,9 +240,7 @@ RTCIceCandidate.prototype = { init: function(win) { this._win = win; }, __init: function(dict) { - this.candidate = dict.candidate; - this.sdpMid = dict.sdpMid; - this.sdpMLineIndex = ("sdpMLineIndex" in dict)? dict.sdpMLineIndex : null; + Object.assign(this, dict); } }; diff --git a/dom/webidl/RTCIceCandidate.webidl b/dom/webidl/RTCIceCandidate.webidl index 67d479aef200..35b404bb7db8 100644 --- a/dom/webidl/RTCIceCandidate.webidl +++ b/dom/webidl/RTCIceCandidate.webidl @@ -8,16 +8,16 @@ */ dictionary RTCIceCandidateInit { - DOMString? candidate = null; + required DOMString candidate; DOMString? sdpMid = null; - unsigned short sdpMLineIndex; + unsigned short? sdpMLineIndex = null; }; [Pref="media.peerconnection.enabled", JSImplementation="@mozilla.org/dom/rtcicecandidate;1", - Constructor(optional RTCIceCandidateInit candidateInitDict)] + Constructor(RTCIceCandidateInit candidateInitDict)] interface RTCIceCandidate { - attribute DOMString? candidate; + attribute DOMString candidate; attribute DOMString? sdpMid; attribute unsigned short? sdpMLineIndex;