Bug 1464079 - Bring ICE connection state change callback up to spec. r=jib, a=RyanVM

This commit is contained in:
Byron Campen [:bwc] 2018-05-31 11:30:19 -05:00 committed by Roy Tam
commit 03766e63da

View file

@ -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:
*