зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1063971: Allow SetRemoteDescription to omit callbacks again r=jib
This commit is contained in:
Родитель
d2bd0b3039
Коммит
e288a72efd
|
@ -679,16 +679,19 @@ RTCPeerConnection.prototype = {
|
||||||
let idpComplete = false;
|
let idpComplete = false;
|
||||||
let setRemoteComplete = false;
|
let setRemoteComplete = false;
|
||||||
let idpError = null;
|
let idpError = null;
|
||||||
|
let isDone = false;
|
||||||
|
|
||||||
// we can run the IdP validation in parallel with setRemoteDescription this
|
// we can run the IdP validation in parallel with setRemoteDescription this
|
||||||
// complicates much more than would be ideal, but it ensures that the IdP
|
// complicates much more than would be ideal, but it ensures that the IdP
|
||||||
// doesn't hold things up too much when it's not on the critical path
|
// doesn't hold things up too much when it's not on the critical path
|
||||||
let allDone = () => {
|
let allDone = () => {
|
||||||
if (!setRemoteComplete || !idpComplete || !onSuccess) {
|
if (!setRemoteComplete || !idpComplete || isDone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// May be null if the user didn't supply success/failure callbacks.
|
||||||
|
// Violation of spec, but we allow it for now
|
||||||
this.callCB(onSuccess);
|
this.callCB(onSuccess);
|
||||||
onSuccess = null;
|
isDone = true;
|
||||||
this._executeNext();
|
this._executeNext();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче