Bug 1917462 - Convert anonymous lambda to a named lambda in FactoryOp::DirectoryLockAcquired; r=dom-storage-reviewers,jari

Differential Revision: https://phabricator.services.mozilla.com/D219630
This commit is contained in:
Jan Varga 2024-09-16 22:17:06 +00:00
Родитель 2a40f1a47a
Коммит e95b3e3870
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -15075,15 +15075,17 @@ void FactoryOp::DirectoryLockAcquired(DirectoryLock* aLock) {
MOZ_ASSERT(mDirectoryLock->Id() >= 0);
mDirectoryLockId = mDirectoryLock->Id();
QM_WARNONLY_TRY(MOZ_TO_RESULT(DirectoryOpen()), [this](const nsresult rv) {
SetFailureCodeIfUnset(rv);
auto cleanupAndReturn = [self = RefPtr(this)](const nsresult rv) {
self->SetFailureCodeIfUnset(rv);
// The caller holds a strong reference to us, no need for a self reference
// before calling Run().
mState = State::SendingResults;
MOZ_ALWAYS_SUCCEEDS(Run());
});
self->mState = State::SendingResults;
MOZ_ALWAYS_SUCCEEDS(self->Run());
};
QM_WARNONLY_TRY(MOZ_TO_RESULT(DirectoryOpen()), cleanupAndReturn);
}
void FactoryOp::DirectoryLockFailed() {