diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index 367d1d789ad5..0716f9db6c12 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -291,7 +291,9 @@ PeerConnection.prototype = { * call _executeNext, false if it doesn't have a callback. */ _queueOrRun: function(obj) { - this._checkClosed(); + if (this._closed) { + return; + } if (!this._pending) { if (obj.type !== undefined) { this._pendingType = obj.type; @@ -354,16 +356,6 @@ PeerConnection.prototype = { return true; }, - // Ideally, this should be of the form _checkState(state), - // where the state is taken from an enumeration containing - // the valid peer connection states defined in the WebRTC - // spec. See Bug 831756. - _checkClosed: function() { - if (this._closed) { - throw new Error ("Peer connection is closed"); - } - }, - createOffer: function(onSuccess, onError, constraints) { if (!constraints) { constraints = {}; @@ -416,9 +408,6 @@ PeerConnection.prototype = { }, setLocalDescription: function(desc, onSuccess, onError) { - // TODO -- if we have two setLocalDescriptions in the - // queue,this code overwrites the callbacks for the first - // one with the callbacks for the second one. See Bug 831759. this._onSetLocalDescriptionSuccess = onSuccess; this._onSetLocalDescriptionFailure = onError; @@ -446,9 +435,6 @@ PeerConnection.prototype = { }, setRemoteDescription: function(desc, onSuccess, onError) { - // TODO -- if we have two setRemoteDescriptions in the - // queue, this code overwrites the callbacks for the first - // one with the callbacks for the second one. See Bug 831759. this._onSetRemoteDescriptionSuccess = onSuccess; this._onSetRemoteDescriptionFailure = onError; @@ -522,17 +508,14 @@ PeerConnection.prototype = { }, get localStreams() { - this._checkClosed(); return this._pc.localStreams; }, get remoteStreams() { - this._checkClosed(); return this._pc.remoteStreams; }, get localDescription() { - this._checkClosed(); let sdp = this._pc.localDescription; if (sdp.length == 0) { return null; @@ -544,7 +527,6 @@ PeerConnection.prototype = { }, get remoteDescription() { - this._checkClosed(); let sdp = this._pc.remoteDescription; if (sdp.length == 0) { return null; @@ -556,7 +538,6 @@ PeerConnection.prototype = { }, createDataChannel: function(label, dict) { - this._checkClosed(); if (dict && dict.maxRetransmitTime != undefined && dict.maxRetransmitNum != undefined) { @@ -574,8 +555,6 @@ PeerConnection.prototype = { } // Synchronous since it doesn't block. - // TODO -- this may need to be revisited, based on how the - // spec ends up defining data channel handling let channel = this._pc.createDataChannel( label, type, dict.outOfOrderAllowed, dict.maxRetransmitTime, dict.maxRetransmitNum @@ -595,7 +574,7 @@ PeerConnection.prototype = { } }; -// This is a separate object because we don't want to expose it to DOM. +// This is a seperate object because we don't want to expose it to DOM. function PeerConnectionObserver(dompc) { this._dompc = dompc; } diff --git a/dom/media/tests/mochitest/Makefile.in b/dom/media/tests/mochitest/Makefile.in index a17c63836ae1..2c15cf758242 100644 --- a/dom/media/tests/mochitest/Makefile.in +++ b/dom/media/tests/mochitest/Makefile.in @@ -19,7 +19,6 @@ MOCHITEST_FILES = \ test_peerConnection_basicAudioVideo.html \ test_peerConnection_basicAudioVideoCombined.html \ test_peerConnection_basicVideo.html \ - test_peerConnection_bug827843.html \ head.js \ mediaStreamPlayback.js \ pc.js \ diff --git a/dom/media/tests/mochitest/test_peerConnection_bug827843.html b/dom/media/tests/mochitest/test_peerConnection_bug827843.html deleted file mode 100644 index 31c68a8e3e63..000000000000 --- a/dom/media/tests/mochitest/test_peerConnection_bug827843.html +++ /dev/null @@ -1,115 +0,0 @@ - - - -
- -- -- -