Bug 1169867 - XMLHttpRequest::SendInternal should not unpin itself when the worker goes away. r=bent

This commit is contained in:
Andrea Marchesini 2015-06-12 10:06:19 -04:00
parent 66ac2c8e93
commit 80e037173b

View File

@ -1882,6 +1882,11 @@ XMLHttpRequest::SendInternal(const nsAString& aStringBody,
new SendRunnable(mWorkerPrivate, mProxy, aStringBody, Move(aBody),
aClonedObjects, syncLoopTarget, hasUploadListeners);
if (!runnable->Dispatch(cx)) {
// Dispatch() may have spun the event loop and we may have already unrooted.
// If so we don't want autoUnpin to try again.
if (!mRooted) {
autoUnpin.Clear();
}
aRv.Throw(NS_ERROR_FAILURE);
return;
}