mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1025352 - fix race condition between waiting for event and setting a timeout for it. r=gmealer
This commit is contained in:
parent
3ef149fde8
commit
dc83fbf8be
@ -1372,7 +1372,7 @@ function PeerConnectionWrapper(label, configuration) {
|
||||
self.attachMedia(event.stream, type, 'remote');
|
||||
|
||||
Object.keys(self.addStreamCallbacks).forEach(function(name) {
|
||||
info(this + " calling addStreamCallback " + name);
|
||||
info(self + " calling addStreamCallback " + name);
|
||||
self.addStreamCallbacks[name]();
|
||||
});
|
||||
};
|
||||
@ -1911,8 +1911,8 @@ PeerConnectionWrapper.prototype = {
|
||||
var addStreamTimeout = null;
|
||||
|
||||
function _checkMediaTracks(constraintsRemote, onSuccess) {
|
||||
if (self.addStreamTimeout !== null) {
|
||||
clearTimeout(self.addStreamTimeout);
|
||||
if (addStreamTimeout !== null) {
|
||||
clearTimeout(addStreamTimeout);
|
||||
}
|
||||
|
||||
var localConstraintAudioTracks =
|
||||
@ -1961,8 +1961,10 @@ PeerConnectionWrapper.prototype = {
|
||||
_checkMediaTracks(constraintsRemote, onSuccess);
|
||||
};
|
||||
addStreamTimeout = setTimeout(function () {
|
||||
ok(false, self + " checkMediaTracks() timed out waiting for onaddstream event to fire");
|
||||
onSuccess();
|
||||
ok(self.onAddStreamFired, self + " checkMediaTracks() timed out waiting for onaddstream event to fire");
|
||||
if (!self.onAddStreamFired) {
|
||||
onSuccess();
|
||||
}
|
||||
}, 60000);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user