Bug 1263312 - Update RTCIceCandidate to spec.
MozReview-Commit-ID: 6S60dAWgZH5
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -224,32 +224,28 @@ GlobalPCList.prototype = {
},
_registerPeerConnectionLifecycleCallback: function(winID, cb) {
this._lifecycleobservers[winID] = cb;
},
};
var _globalPCList = new GlobalPCList();
-function RTCIceCandidate() {
- this.candidate = this.sdpMid = this.sdpMLineIndex = null;
-}
+function RTCIceCandidate() {}
RTCIceCandidate.prototype = {
classDescription: "RTCIceCandidate",
classID: PC_ICE_CID,
contractID: PC_ICE_CONTRACT,
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
Ci.nsIDOMGlobalPropertyInitializer]),
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);
}
};
function RTCSessionDescription() {}
RTCSessionDescription.prototype = {
classDescription: "RTCSessionDescription",
classID: PC_SESSION_CID,
contractID: PC_SESSION_CONTRACT,
--- a/dom/webidl/RTCIceCandidate.webidl
+++ b/dom/webidl/RTCIceCandidate.webidl
@@ -3,23 +3,23 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCIceCandidate
*/
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;
jsonifier;
};