Bug 792834 - 'Make sure to always set errors on failed requests'. r=khuey.

This commit is contained in:
Ben Turner 2012-09-20 11:20:15 -07:00
parent 1e818bad1c
commit da36cf378c

View File

@ -81,12 +81,6 @@ IDBRequest::NotifyHelperCompleted(HelperBase* aHelper)
NS_ASSERTION(!mHaveResultOrErrorCode, "Already called!");
NS_ASSERTION(JSVAL_IS_VOID(mResultVal), "Should be undefined!");
// See if our window is still valid. If not then we're going to pretend that
// we never completed.
if (NS_FAILED(CheckInnerWindowCorrectness())) {
return NS_OK;
}
mHaveResultOrErrorCode = true;
nsresult rv = aHelper->GetResultCode();
@ -97,6 +91,12 @@ IDBRequest::NotifyHelperCompleted(HelperBase* aHelper)
return NS_OK;
}
// See if our window is still valid. If not then we're going to pretend that
// we never completed.
if (NS_FAILED(CheckInnerWindowCorrectness())) {
return NS_OK;
}
// Otherwise we need to get the result from the helper.
JSContext* cx = GetJSContext();
if (!cx) {