1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_indexeddb_client_h__
8 #define mozilla_dom_indexeddb_client_h__
10 #include "IndexedDatabase.h"
12 #include "mozilla/dom/quota/Client.h"
14 #define JOURNAL_DIRECTORY_NAME "journals"
16 BEGIN_INDEXEDDB_NAMESPACE
18 class Client
: public mozilla::dom::quota::Client
20 typedef mozilla::dom::quota::OriginOrPatternString OriginOrPatternString
;
21 typedef mozilla::dom::quota::PersistenceType PersistenceType
;
22 typedef mozilla::dom::quota::UsageInfo UsageInfo
;
25 NS_IMETHOD_(MozExternalRefCountType
)
26 AddRef() MOZ_OVERRIDE
;
28 NS_IMETHOD_(MozExternalRefCountType
)
29 Release() MOZ_OVERRIDE
;
32 GetType() MOZ_OVERRIDE
38 InitOrigin(PersistenceType aPersistenceType
,
39 const nsACString
& aGroup
,
40 const nsACString
& aOrigin
,
41 UsageInfo
* aUsageInfo
) MOZ_OVERRIDE
;
44 GetUsageForOrigin(PersistenceType aPersistenceType
,
45 const nsACString
& aGroup
,
46 const nsACString
& aOrigin
,
47 UsageInfo
* aUsageInfo
) MOZ_OVERRIDE
;
50 OnOriginClearCompleted(PersistenceType aPersistenceType
,
51 const OriginOrPatternString
& aOriginOrPattern
)
55 ReleaseIOThreadObjects() MOZ_OVERRIDE
;
58 IsFileServiceUtilized() MOZ_OVERRIDE
64 IsTransactionServiceActivated() MOZ_OVERRIDE
;
67 WaitForStoragesToComplete(nsTArray
<nsIOfflineStorage
*>& aStorages
,
68 nsIRunnable
* aCallback
) MOZ_OVERRIDE
;
71 AbortTransactionsForStorage(nsIOfflineStorage
* aStorage
) MOZ_OVERRIDE
;
74 HasTransactionsForStorage(nsIOfflineStorage
* aStorage
) MOZ_OVERRIDE
;
77 ShutdownTransactionService() MOZ_OVERRIDE
;
83 GetDirectory(PersistenceType aPersistenceType
, const nsACString
& aOrigin
,
84 nsIFile
** aDirectory
);
87 GetUsageForDirectoryInternal(nsIFile
* aDirectory
,
88 UsageInfo
* aUsageInfo
,
95 END_INDEXEDDB_NAMESPACE
97 #endif // mozilla_dom_indexeddb_client_h__