Bug 1709138 - Fix a crash in MutableBlobStorage related to a wrong error propagation logic, r=asuth

Differential Revision: https://phabricator.services.mozilla.com/D236168
This commit is contained in:
Andrea Marchesini
2025-01-30 16:28:11 +00:00
parent 5e0c1d2e01
commit 1b75f9f13d

View File

@@ -339,8 +339,6 @@ void MutableBlobStorage::GetBlobImplWhenReady(
return;
}
MOZ_ASSERT(mActor);
// We want to wait until all the WriteRunnable are completed. The way we do
// this is to go to the I/O thread and then we come back: the runnables are
// executed in order and this LastRunnable will be... the last one.
@@ -594,9 +592,19 @@ void MutableBlobStorage::AskForBlob(TemporaryIPCBlobChildCallback* aCallback,
MutexAutoLock lock(mMutex);
MOZ_ASSERT(mStorageState == eClosed);
MOZ_ASSERT(aCallback);
// If something went wrong in one of the previous WriteRunnable runnables,
// it's time to report the error.
if (NS_FAILED(mErrorResult)) {
MOZ_ASSERT(!mFD);
MOZ_ASSERT(!mActor);
aCallback->OperationFailed(mErrorResult);
return;
}
MOZ_ASSERT(mFD);
MOZ_ASSERT(mActor);
MOZ_ASSERT(aCallback);
// Let's pass the FileDescriptor to the parent actor in order to keep the file
// locked on windows.