From f7141fa1291fe89c959847dbd601ba167261f567 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Wed, 21 Nov 2012 15:52:43 +0100 Subject: [PATCH] Bug 813885 - RTCIceCandidate constructor arguments don't match spec. r=jesup --- dom/media/PeerConnection.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index c576ac306568..b8b2333a0157 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -114,14 +114,18 @@ IceCandidate.prototype = { Ci.nsIDOMRTCIceCandidate, Ci.nsIDOMGlobalObjectConstructor ]), - constructor: function(win, cand, mid, mline) { + constructor: function(win, candidateInitDict) { if (this._win) { throw new Error("Constructor already called"); } this._win = win; - this.candidate = cand; - this.sdpMid = mid; - this.sdpMLineIndex = mline; + if (candidateInitDict !== undefined) { + this.candidate = candidateInitDict.candidate || null; + this.sdpMid = candidateInitDict.sdbMid || null; + this.sdpMLineIndex = candidateInitDict.sdpMLineIndex || null; + } else { + this.candidate = this.sdpMid = this.sdpMLineIndex = null; + } } };