Bug 1037729 - Moving callbacks to run after reaching steady state. r=jib

This commit is contained in:
Martin Thomson 2014-07-15 11:19:00 +02:00
parent bc2e859932
commit 8712497a35

View File

@ -358,14 +358,16 @@ RTCPeerConnection.prototype = {
callCB: function(callback, arg) {
if (callback) {
try {
callback(arg);
} catch(e) {
// A content script (user-provided) callback threw an error. We don't
// want this to take down peerconnection, but we still want the user
// to see it, so we catch it, report it, and move on.
this.logErrorAndCallOnError(e.message, e.fileName, e.lineNumber);
}
this._win.setTimeout(() => {
try {
callback(arg);
} catch(e) {
// A content script (user-provided) callback threw an error. We don't
// want this to take down peerconnection, but we still want the user
// to see it, so we catch it, report it, and move on.
this.logErrorAndCallOnError(e.message, e.fileName, e.lineNumber);
}
}, 0);
}
},