Bug 872839 - Part 1: Put new PeerConnections on global list earlier, ensuring close is called should PC.initialize fail. r=jesup

This commit is contained in:
Jan-Ivar Bruaroey 2013-05-22 13:05:20 -04:00
Родитель 98339e6a93
Коммит a664470d9e
1 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -295,6 +295,11 @@ RTCPeerConnection.prototype = {
this._pc = Cc["@mozilla.org/peerconnection;1"].
createInstance(Ci.IPeerConnection);
this._observer = new PeerConnectionObserver(this);
this._winID = this._win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
// Add a reference to the PeerConnection to global list (before init).
_globalPCList.addPC(this);
// Nothing starts until ICE gathering completes.
this._queueOrRun({
@ -302,12 +307,6 @@ RTCPeerConnection.prototype = {
args: [this._observer, this._win, rtcConfig, Services.tm.currentThread],
wait: true
});
this._winID = this._win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
// Add a reference to the PeerConnection to global list.
_globalPCList.addPC(this);
},
_getPC: function() {