mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1839417 - Move QuotaManager::CollectPendingOriginsForListing implementation to QuotaManagerImpl.h; r=dom-storage-reviewers,asuth
QuotaManager::CollectPendingOriginsForListing is a public template function so it shouldn't be implemented in a cpp file. (needed for moving operations outside ActorsParent.cpp) Differential Revision: https://phabricator.services.mozilla.com/D181478
This commit is contained in:
parent
84236733a9
commit
dc0856d1d0
@ -3200,28 +3200,6 @@ uint64_t QuotaManager::CollectOriginsForEviction(
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
void QuotaManager::CollectPendingOriginsForListing(P aPredicate) {
|
||||
MutexAutoLock lock(mQuotaMutex);
|
||||
|
||||
for (const auto& entry : mGroupInfoPairs) {
|
||||
const auto& pair = entry.GetData();
|
||||
|
||||
MOZ_ASSERT(!entry.GetKey().IsEmpty());
|
||||
MOZ_ASSERT(pair);
|
||||
|
||||
RefPtr<GroupInfo> groupInfo =
|
||||
pair->LockedGetGroupInfo(PERSISTENCE_TYPE_DEFAULT);
|
||||
if (groupInfo) {
|
||||
for (const auto& originInfo : groupInfo->mOriginInfos) {
|
||||
if (!originInfo->mDirectoryExists) {
|
||||
aPredicate(originInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsresult QuotaManager::Init() {
|
||||
AssertIsOnOwningThread();
|
||||
|
||||
|
@ -7,10 +7,35 @@
|
||||
#ifndef DOM_QUOTA_QUOTAMANAGERIMPL_H_
|
||||
#define DOM_QUOTA_QUOTAMANAGERIMPL_H_
|
||||
|
||||
#include "QuotaManager.h"
|
||||
#include "GroupInfo.h"
|
||||
#include "GroupInfoPair.h"
|
||||
#include "mozilla/dom/quota/QuotaManager.h"
|
||||
#include "OriginInfo.h"
|
||||
|
||||
namespace mozilla::dom::quota {
|
||||
|
||||
template <typename P>
|
||||
void QuotaManager::CollectPendingOriginsForListing(P aPredicate) {
|
||||
MutexAutoLock lock(mQuotaMutex);
|
||||
|
||||
for (const auto& entry : mGroupInfoPairs) {
|
||||
const auto& pair = entry.GetData();
|
||||
|
||||
MOZ_ASSERT(!entry.GetKey().IsEmpty());
|
||||
MOZ_ASSERT(pair);
|
||||
|
||||
RefPtr<GroupInfo> groupInfo =
|
||||
pair->LockedGetGroupInfo(PERSISTENCE_TYPE_DEFAULT);
|
||||
if (groupInfo) {
|
||||
for (const auto& originInfo : groupInfo->mOriginInfos) {
|
||||
if (!originInfo->mDirectoryExists) {
|
||||
aPredicate(originInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
void QuotaManager::MaybeRecordQuotaManagerShutdownStepWith(F&& aFunc) {
|
||||
// Callable on any thread.
|
||||
|
Loading…
x
Reference in New Issue
Block a user