[IndexedDB] Call SendFailureResult if the actor has been destroyed.
parent
bc02c55204
commit
1da6381a9f
|
@ -23717,32 +23717,38 @@ TransactionDatabaseOperationBase::SendPreprocessInfoOrResults(
|
||||||
MOZ_ASSERT(mTransaction);
|
MOZ_ASSERT(mTransaction);
|
||||||
|
|
||||||
if (NS_WARN_IF(IsActorDestroyed())) {
|
if (NS_WARN_IF(IsActorDestroyed())) {
|
||||||
// Don't send any notifications if the actor was destroyed already.
|
// Normally we wouldn't need to send any notifications if the actor was
|
||||||
|
// already destroyed, but this can be a VersionChangeOp which needs to
|
||||||
|
// notify its parent operation (OpenDatabaseOp) about the failure.
|
||||||
|
// So SendFailureResult needs to be called even when the actor was
|
||||||
|
// destroyed. Normal operations redundantly check if the actor was
|
||||||
|
// destroyed in SendSuccessResult and SendFailureResult, therefore it's
|
||||||
|
// ok to call it in all cases here.
|
||||||
if (NS_SUCCEEDED(mResultCode)) {
|
if (NS_SUCCEEDED(mResultCode)) {
|
||||||
IDB_REPORT_INTERNAL_ERR();
|
IDB_REPORT_INTERNAL_ERR();
|
||||||
mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) {
|
||||||
if (mTransaction->IsInvalidated() || mTransaction->IsAborted()) {
|
// Aborted transactions always see their requests fail with ABORT_ERR,
|
||||||
// Aborted transactions always see their requests fail with ABORT_ERR,
|
// even if the request succeeded or failed with another error.
|
||||||
// even if the request succeeded or failed with another error.
|
mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR;
|
||||||
mResultCode = NS_ERROR_DOM_INDEXEDDB_ABORT_ERR;
|
}
|
||||||
} else if (NS_SUCCEEDED(mResultCode)) {
|
|
||||||
if (aSendPreprocessInfo) {
|
if (NS_SUCCEEDED(mResultCode)) {
|
||||||
// This should not release the IPDL reference.
|
if (aSendPreprocessInfo) {
|
||||||
mResultCode = SendPreprocessInfo();
|
// This should not release the IPDL reference.
|
||||||
} else {
|
mResultCode = SendPreprocessInfo();
|
||||||
// This may release the IPDL reference.
|
} else {
|
||||||
mResultCode = SendSuccessResult();
|
// This may release the IPDL reference.
|
||||||
}
|
mResultCode = SendSuccessResult();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (NS_FAILED(mResultCode)) {
|
if (NS_FAILED(mResultCode)) {
|
||||||
// This should definitely release the IPDL reference.
|
// This should definitely release the IPDL reference.
|
||||||
if (!SendFailureResult(mResultCode)) {
|
if (!SendFailureResult(mResultCode)) {
|
||||||
// Abort the transaction.
|
// Abort the transaction.
|
||||||
mTransaction->Abort(mResultCode, /* aForce */ false);
|
mTransaction->Abort(mResultCode, /* aForce */ false);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue