Bug 813885 - RTCIceCandidate constructor arguments don't match spec. r=jesup

This commit is contained in:
Paul Adenot 2012-11-21 15:52:43 +01:00
parent 18de49f4ce
commit f7141fa129

View File

@ -114,14 +114,18 @@ IceCandidate.prototype = {
Ci.nsIDOMRTCIceCandidate, Ci.nsIDOMGlobalObjectConstructor Ci.nsIDOMRTCIceCandidate, Ci.nsIDOMGlobalObjectConstructor
]), ]),
constructor: function(win, cand, mid, mline) { constructor: function(win, candidateInitDict) {
if (this._win) { if (this._win) {
throw new Error("Constructor already called"); throw new Error("Constructor already called");
} }
this._win = win; this._win = win;
this.candidate = cand; if (candidateInitDict !== undefined) {
this.sdpMid = mid; this.candidate = candidateInitDict.candidate || null;
this.sdpMLineIndex = mline; this.sdpMid = candidateInitDict.sdbMid || null;
this.sdpMLineIndex = candidateInitDict.sdpMLineIndex || null;
} else {
this.candidate = this.sdpMid = this.sdpMLineIndex = null;
}
} }
}; };