mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
Bug 1700676 - Unregister the lock itself before unblock other locks; r=dom-storage-reviewers,sg,janv
Differential Revision: https://phabricator.services.mozilla.com/D109640
This commit is contained in:
parent
1631cf13b6
commit
be03b11109
@ -45,17 +45,25 @@ DirectoryLockImpl::DirectoryLockImpl(
|
|||||||
DirectoryLockImpl::~DirectoryLockImpl() {
|
DirectoryLockImpl::~DirectoryLockImpl() {
|
||||||
AssertIsOnOwningThread();
|
AssertIsOnOwningThread();
|
||||||
|
|
||||||
for (NotNull<RefPtr<DirectoryLockImpl>> blockingLock : mBlocking) {
|
// We must call UnregisterDirectoryLock before unblocking other locks because
|
||||||
blockingLock->MaybeUnblock(*this);
|
// UnregisterDirectoryLock also updates the origin last access time and the
|
||||||
}
|
// access flag (if the last lock for given origin is unregistered). One of the
|
||||||
|
// blocked locks could be requested by the clear/reset operation which stores
|
||||||
mBlocking.Clear();
|
// cached information about origins in storage.sqlite. So if the access flag
|
||||||
|
// is not updated before unblocking the lock for reset/clear, we might store
|
||||||
|
// invalid information which can lead to omitting origin initialization during
|
||||||
|
// next temporary storage initialization.
|
||||||
if (mRegistered) {
|
if (mRegistered) {
|
||||||
mQuotaManager->UnregisterDirectoryLock(*this);
|
mQuotaManager->UnregisterDirectoryLock(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(!mRegistered);
|
MOZ_ASSERT(!mRegistered);
|
||||||
|
|
||||||
|
for (NotNull<RefPtr<DirectoryLockImpl>> blockingLock : mBlocking) {
|
||||||
|
blockingLock->MaybeUnblock(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
mBlocking.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user