1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_QUOTA_QUOTAMANAGERIMPL_H_
8 #define DOM_QUOTA_QUOTAMANAGERIMPL_H_
10 #include "GroupInfo.h"
11 #include "GroupInfoPair.h"
12 #include "mozilla/dom/quota/QuotaManager.h"
13 #include "OriginInfo.h"
15 namespace mozilla::dom::quota
{
18 void QuotaManager::CollectPendingOriginsForListing(P aPredicate
) {
19 MutexAutoLock
lock(mQuotaMutex
);
21 for (const auto& entry
: mGroupInfoPairs
) {
22 const auto& pair
= entry
.GetData();
24 MOZ_ASSERT(!entry
.GetKey().IsEmpty());
27 RefPtr
<GroupInfo
> groupInfo
=
28 pair
->LockedGetGroupInfo(PERSISTENCE_TYPE_DEFAULT
);
30 for (const auto& originInfo
: groupInfo
->mOriginInfos
) {
31 if (!originInfo
->mDirectoryExists
) {
32 aPredicate(originInfo
);
40 void QuotaManager::MaybeRecordQuotaManagerShutdownStepWith(F
&& aFunc
) {
41 // Callable on any thread.
43 if (IsShuttingDown()) {
44 RecordShutdownStep(Nothing
{}, std::forward
<F
>(aFunc
)());
48 } // namespace mozilla::dom::quota
50 #endif // DOM_QUOTA_QUOTAMANAGERIMPL_H_