Bug 1806362 - FileQuotaStreamWithWrite::Write should return zero written bytes in the failure case; r=dom-storage-reviewers,jari

This bug causes NS_AsyncCopy to call the progress callback with random values
when there's an error during writing.

Depends on D165069

Differential Revision: https://phabricator.services.mozilla.com/D165070
This commit is contained in:
Jan Varga 2023-01-07 11:01:36 +00:00
Родитель 9fa197f7d1
Коммит 8caeb1cbe6
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -93,6 +93,7 @@ NS_IMETHODIMP FileQuotaStreamWithWrite<FileStreamBase>::Write(
if (!FileQuotaStreamWithWrite::mQuotaObject->MaybeUpdateSize(
offset + int64_t(aCount),
/* aTruncate */ false)) {
*_retval = 0;
return NS_ERROR_FILE_NO_DEVICE_SPACE;
}
}