FileSystemQuotaClient.h (2182B)
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/. */ 6 7 #ifndef DOM_FS_PARENT_FILESYSTEMQUOTACLIENT_H_ 8 #define DOM_FS_PARENT_FILESYSTEMQUOTACLIENT_H_ 9 10 #include "mozilla/dom/quota/Client.h" 11 12 namespace mozilla::dom::fs { 13 14 class FileSystemQuotaClient : public quota::Client { 15 public: 16 FileSystemQuotaClient(); 17 18 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(mozilla::dom::fs::FileSystemQuotaClient, 19 override) 20 21 Type GetType() override; 22 23 Result<quota::UsageInfo, nsresult> InitOrigin( 24 quota::PersistenceType aPersistenceType, 25 const quota::OriginMetadata& aOriginMetadata, 26 const AtomicBool& aCanceled) override; 27 28 nsresult InitOriginWithoutTracking( 29 quota::PersistenceType aPersistenceType, 30 const quota::OriginMetadata& aOriginMetadata, 31 const AtomicBool& aCanceled) override; 32 33 Result<quota::UsageInfo, nsresult> GetUsageForOrigin( 34 quota::PersistenceType aPersistenceType, 35 const quota::OriginMetadata& aOriginMetadata, 36 const AtomicBool& aCanceled) override; 37 38 void OnOriginClearCompleted( 39 const quota::OriginMetadata& aOriginMetadata) override; 40 41 void OnRepositoryClearCompleted( 42 quota::PersistenceType aPersistenceType) override; 43 44 void ReleaseIOThreadObjects() override; 45 46 void AbortOperationsForLocks( 47 const DirectoryLockIdTable& aDirectoryLockIds) override; 48 49 void AbortOperationsForProcess(ContentParentId aContentParentId) override; 50 51 void AbortAllOperations() override; 52 53 void StartIdleMaintenance() override; 54 55 void StopIdleMaintenance() override; 56 57 protected: 58 ~FileSystemQuotaClient() = default; 59 60 void InitiateShutdown() override; 61 bool IsShutdownCompleted() const override; 62 nsCString GetShutdownStatus() const override; 63 void ForceKillActors() override; 64 void FinalizeShutdown() override; 65 }; 66 67 } // namespace mozilla::dom::fs 68 69 #endif // DOM_FS_PARENT_FILESYSTEMQUOTACLIENT_H_