Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in dom/storage. r=dom-storage-reviewers,janv

Differential Revision: https://phabricator.services.mozilla.com/D104217
This commit is contained in:
Simon Giesecke 2021-02-09 18:19:40 +00:00
parent 8df74b1582
commit 8444825010

View File

@ -632,8 +632,10 @@ BackgroundSessionStorageManager* BackgroundSessionStorageManager::GetOrCreate(
}));
}
return sManagers->LookupForAdd(aTopContextId).OrInsert([] {
return new BackgroundSessionStorageManager();
return sManagers->WithEntryHandle(aTopContextId, [](auto&& entry) {
return entry
.OrInsertWith([] { return new BackgroundSessionStorageManager(); })
.get();
});
}