Bug 1701346 - CACHE: Revert QM_OR_ELSE_WARN to ordinary orElse in BodyGetCacheDir; r=asuth,dom-storage-reviewers,jstutte

Depends on D113067

Differential Revision: https://phabricator.services.mozilla.com/D113068
This commit is contained in:
Jan Varga 2021-04-24 08:58:31 +00:00
Родитель 8fd7eedb03
Коммит 1910186fa7
1 изменённых файлов: 5 добавлений и 3 удалений

8
dom/cache/FileUtils.cpp поставляемый
Просмотреть файл

@ -89,9 +89,11 @@ Result<NotNull<nsCOMPtr<nsIFile>>, nsresult> BodyGetCacheDir(nsIFile& aBaseDir,
// the name of the sub-directory.
CACHE_TRY(cacheDir->Append(IntToString(aId.m3[7])));
QM_TRY(
QM_OR_ELSE_WARN(ToResult(cacheDir->Create(nsIFile::DIRECTORY_TYPE, 0755)),
ErrToDefaultOkOrErr<NS_ERROR_FILE_ALREADY_EXISTS>));
// Callers call this function without checking if the directory already
// exists (idempotent usage). QM_OR_ELSE_WARN is not used here since we want
// to ignore NS_ERROR_FILE_ALREADY_EXISTS completely.
QM_TRY(ToResult(cacheDir->Create(nsIFile::DIRECTORY_TYPE, 0755))
.orElse(ErrToDefaultOkOrErr<NS_ERROR_FILE_ALREADY_EXISTS>));
return WrapNotNullUnchecked(std::move(cacheDir));
}