Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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
19 {
20 typedef mozilla::dom::quota::OriginOrPatternString OriginOrPatternString;
21 typedef mozilla::dom::quota::PersistenceType PersistenceType;
22 typedef mozilla::dom::quota::UsageInfo UsageInfo;
24 public:
25 NS_IMETHOD_(MozExternalRefCountType)
26 AddRef() MOZ_OVERRIDE;
28 NS_IMETHOD_(MozExternalRefCountType)
29 Release() MOZ_OVERRIDE;
31 virtual Type
32 GetType() MOZ_OVERRIDE
33 {
34 return IDB;
35 }
37 virtual nsresult
38 InitOrigin(PersistenceType aPersistenceType,
39 const nsACString& aGroup,
40 const nsACString& aOrigin,
41 UsageInfo* aUsageInfo) MOZ_OVERRIDE;
43 virtual nsresult
44 GetUsageForOrigin(PersistenceType aPersistenceType,
45 const nsACString& aGroup,
46 const nsACString& aOrigin,
47 UsageInfo* aUsageInfo) MOZ_OVERRIDE;
49 virtual void
50 OnOriginClearCompleted(PersistenceType aPersistenceType,
51 const OriginOrPatternString& aOriginOrPattern)
52 MOZ_OVERRIDE;
54 virtual void
55 ReleaseIOThreadObjects() MOZ_OVERRIDE;
57 virtual bool
58 IsFileServiceUtilized() MOZ_OVERRIDE
59 {
60 return true;
61 }
63 virtual bool
64 IsTransactionServiceActivated() MOZ_OVERRIDE;
66 virtual void
67 WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages,
68 nsIRunnable* aCallback) MOZ_OVERRIDE;
70 virtual void
71 AbortTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE;
73 virtual bool
74 HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE;
76 virtual void
77 ShutdownTransactionService() MOZ_OVERRIDE;
79 private:
80 nsresult
81 GetDirectory(PersistenceType aPersistenceType, const nsACString& aOrigin,
82 nsIFile** aDirectory);
84 nsresult
85 GetUsageForDirectoryInternal(nsIFile* aDirectory,
86 UsageInfo* aUsageInfo,
87 bool aDatabaseFiles);
89 nsAutoRefCnt mRefCnt;
90 NS_DECL_OWNINGTHREAD
91 };
93 END_INDEXEDDB_NAMESPACE
95 #endif // mozilla_dom_indexeddb_client_h__