Bug 1464079 - Bring ICE connection state change callback up to spec. r=jib, a=RyanVM
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 31 May 2018 11:30:19 -0500
changeset 806045 d0efbb8967ccff5e211c9e93a25fbca754e075b7
parent 806044 1248809b8616ccdca655b997843b4bd43e835a14
child 806046 b5045ef425837e86b8406930d1a9d7929a7a4b8b
push id112832
push userbballo@mozilla.com
push dateFri, 08 Jun 2018 21:11:22 +0000
reviewersjib, RyanVM
bugs1464079
milestone60.0.3
Bug 1464079 - Bring ICE connection state change callback up to spec. r=jib, a=RyanVM
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -1798,17 +1798,20 @@ class PeerConnectionObserver {
 
   onStateChange(state) {
     switch (state) {
       case "SignalingState":
         this.dispatchEvent(new this._win.Event("signalingstatechange"));
         break;
 
       case "IceConnectionState":
-        this.handleIceConnectionStateChange(this._dompc._pc.iceConnectionState);
+        let connState = this._dompc._pc.iceConnectionState;
+        this._dompc._queueTaskWithClosedCheck(() => {
+          this.handleIceConnectionStateChange(connState);
+        });
         break;
 
       case "IceGatheringState":
         this.handleIceGatheringStateChange(this._dompc._pc.iceGatheringState);
         break;
 
       default:
         this._dompc.logWarning("Unhandled state type: " + state);