Bug 1979113: Reject AsyncEncodeAndWriteIcon promise if task dispatch fails on Windows r=daisuke,win-reviewers,gstoll, a=dsmith
Reject the promise at destruction unless it has already been resolved/rejected. Also return an error (that is ignored). Differential Revision: https://phabricator.services.mozilla.com/D258614
This commit is contained in:
committed by
dsmith@mozilla.com
parent
6d1ac1135e
commit
c68862e175
@@ -826,9 +826,7 @@ static nsresult CacheFavicon(
|
|||||||
nsCOMPtr<nsIRunnable> event = new AsyncEncodeAndWriteIcon(
|
nsCOMPtr<nsIRunnable> event = new AsyncEncodeAndWriteIcon(
|
||||||
path, std::move(data), stride, size.width, size.height,
|
path, std::move(data), stride, size.width, size.height,
|
||||||
aRunnable.forget(), std::move(aPromiseHolder));
|
aRunnable.forget(), std::move(aPromiseHolder));
|
||||||
aIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
|
return aIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -895,7 +893,11 @@ NS_IMETHODIMP AsyncEncodeAndWriteIcon::Run() {
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncEncodeAndWriteIcon::~AsyncEncodeAndWriteIcon() {}
|
AsyncEncodeAndWriteIcon::~AsyncEncodeAndWriteIcon() {
|
||||||
|
if (mPromiseHolder) {
|
||||||
|
mPromiseHolder->RejectIfExists(NS_ERROR_FAILURE, __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AsyncDeleteAllFaviconsFromDisk::AsyncDeleteAllFaviconsFromDisk(
|
AsyncDeleteAllFaviconsFromDisk::AsyncDeleteAllFaviconsFromDisk(
|
||||||
bool aIgnoreRecent)
|
bool aIgnoreRecent)
|
||||||
|
|||||||
Reference in New Issue
Block a user