michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_dom_indexeddb_client_h__ michael@0: #define mozilla_dom_indexeddb_client_h__ michael@0: michael@0: #include "IndexedDatabase.h" michael@0: michael@0: #include "mozilla/dom/quota/Client.h" michael@0: michael@0: #define JOURNAL_DIRECTORY_NAME "journals" michael@0: michael@0: BEGIN_INDEXEDDB_NAMESPACE michael@0: michael@0: class Client : public mozilla::dom::quota::Client michael@0: { michael@0: typedef mozilla::dom::quota::OriginOrPatternString OriginOrPatternString; michael@0: typedef mozilla::dom::quota::PersistenceType PersistenceType; michael@0: typedef mozilla::dom::quota::UsageInfo UsageInfo; michael@0: michael@0: public: michael@0: NS_IMETHOD_(MozExternalRefCountType) michael@0: AddRef() MOZ_OVERRIDE; michael@0: michael@0: NS_IMETHOD_(MozExternalRefCountType) michael@0: Release() MOZ_OVERRIDE; michael@0: michael@0: virtual Type michael@0: GetType() MOZ_OVERRIDE michael@0: { michael@0: return IDB; michael@0: } michael@0: michael@0: virtual nsresult michael@0: InitOrigin(PersistenceType aPersistenceType, michael@0: const nsACString& aGroup, michael@0: const nsACString& aOrigin, michael@0: UsageInfo* aUsageInfo) MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult michael@0: GetUsageForOrigin(PersistenceType aPersistenceType, michael@0: const nsACString& aGroup, michael@0: const nsACString& aOrigin, michael@0: UsageInfo* aUsageInfo) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: OnOriginClearCompleted(PersistenceType aPersistenceType, michael@0: const OriginOrPatternString& aOriginOrPattern) michael@0: MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: ReleaseIOThreadObjects() MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: IsFileServiceUtilized() MOZ_OVERRIDE michael@0: { michael@0: return true; michael@0: } michael@0: michael@0: virtual bool michael@0: IsTransactionServiceActivated() MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: WaitForStoragesToComplete(nsTArray& aStorages, michael@0: nsIRunnable* aCallback) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: AbortTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE; michael@0: michael@0: virtual bool michael@0: HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE; michael@0: michael@0: virtual void michael@0: ShutdownTransactionService() MOZ_OVERRIDE; michael@0: michael@0: private: michael@0: nsresult michael@0: GetDirectory(PersistenceType aPersistenceType, const nsACString& aOrigin, michael@0: nsIFile** aDirectory); michael@0: michael@0: nsresult michael@0: GetUsageForDirectoryInternal(nsIFile* aDirectory, michael@0: UsageInfo* aUsageInfo, michael@0: bool aDatabaseFiles); michael@0: michael@0: nsAutoRefCnt mRefCnt; michael@0: NS_DECL_OWNINGTHREAD michael@0: }; michael@0: michael@0: END_INDEXEDDB_NAMESPACE michael@0: michael@0: #endif // mozilla_dom_indexeddb_client_h__