diff options
author | Byron Campen [:bwc] <docfaraday@gmail.com> | 2018-05-31 11:30:19 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-29 08:13:40 +0200 |
commit | ce38876a4daa5170485f752d4007c8fdfbbe8ccc (patch) | |
tree | f949f1f870a815394850c53ae3d674cc80c9558f | |
parent | 0cacba361f8c5daf975e12241e939ee82f29a1fa (diff) | |
download | uxp-ce38876a4daa5170485f752d4007c8fdfbbe8ccc.tar.gz |
Bug 1464079 - Bring ICE connection state change callback up to spec. r=jib, a=RyanVM
-rw-r--r-- | dom/media/PeerConnection.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index d13f1d0fbb..0569b15aeb 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -516,6 +516,18 @@ RTCPeerConnection.prototype = { }; }, + // This implements the fairly common "Queue a task" logic + async _queueTaskWithClosedCheck(func) { + return new Promise(resolve => { + Services.tm.mainThread.dispatch({ run() { + if (!this._closed) { + func(); + resolve(); + } + }}, Ci.nsIThread.DISPATCH_NORMAL); + }); + }, + /** * An RTCConfiguration may look like this: * |