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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=2 et sw=2 tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 5 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef mozilla_dom_indexeddb_client_h__ |
michael@0 | 8 | #define mozilla_dom_indexeddb_client_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "IndexedDatabase.h" |
michael@0 | 11 | |
michael@0 | 12 | #include "mozilla/dom/quota/Client.h" |
michael@0 | 13 | |
michael@0 | 14 | #define JOURNAL_DIRECTORY_NAME "journals" |
michael@0 | 15 | |
michael@0 | 16 | BEGIN_INDEXEDDB_NAMESPACE |
michael@0 | 17 | |
michael@0 | 18 | class Client : public mozilla::dom::quota::Client |
michael@0 | 19 | { |
michael@0 | 20 | typedef mozilla::dom::quota::OriginOrPatternString OriginOrPatternString; |
michael@0 | 21 | typedef mozilla::dom::quota::PersistenceType PersistenceType; |
michael@0 | 22 | typedef mozilla::dom::quota::UsageInfo UsageInfo; |
michael@0 | 23 | |
michael@0 | 24 | public: |
michael@0 | 25 | NS_IMETHOD_(MozExternalRefCountType) |
michael@0 | 26 | AddRef() MOZ_OVERRIDE; |
michael@0 | 27 | |
michael@0 | 28 | NS_IMETHOD_(MozExternalRefCountType) |
michael@0 | 29 | Release() MOZ_OVERRIDE; |
michael@0 | 30 | |
michael@0 | 31 | virtual Type |
michael@0 | 32 | GetType() MOZ_OVERRIDE |
michael@0 | 33 | { |
michael@0 | 34 | return IDB; |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | virtual nsresult |
michael@0 | 38 | InitOrigin(PersistenceType aPersistenceType, |
michael@0 | 39 | const nsACString& aGroup, |
michael@0 | 40 | const nsACString& aOrigin, |
michael@0 | 41 | UsageInfo* aUsageInfo) MOZ_OVERRIDE; |
michael@0 | 42 | |
michael@0 | 43 | virtual nsresult |
michael@0 | 44 | GetUsageForOrigin(PersistenceType aPersistenceType, |
michael@0 | 45 | const nsACString& aGroup, |
michael@0 | 46 | const nsACString& aOrigin, |
michael@0 | 47 | UsageInfo* aUsageInfo) MOZ_OVERRIDE; |
michael@0 | 48 | |
michael@0 | 49 | virtual void |
michael@0 | 50 | OnOriginClearCompleted(PersistenceType aPersistenceType, |
michael@0 | 51 | const OriginOrPatternString& aOriginOrPattern) |
michael@0 | 52 | MOZ_OVERRIDE; |
michael@0 | 53 | |
michael@0 | 54 | virtual void |
michael@0 | 55 | ReleaseIOThreadObjects() MOZ_OVERRIDE; |
michael@0 | 56 | |
michael@0 | 57 | virtual bool |
michael@0 | 58 | IsFileServiceUtilized() MOZ_OVERRIDE |
michael@0 | 59 | { |
michael@0 | 60 | return true; |
michael@0 | 61 | } |
michael@0 | 62 | |
michael@0 | 63 | virtual bool |
michael@0 | 64 | IsTransactionServiceActivated() MOZ_OVERRIDE; |
michael@0 | 65 | |
michael@0 | 66 | virtual void |
michael@0 | 67 | WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages, |
michael@0 | 68 | nsIRunnable* aCallback) MOZ_OVERRIDE; |
michael@0 | 69 | |
michael@0 | 70 | virtual void |
michael@0 | 71 | AbortTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE; |
michael@0 | 72 | |
michael@0 | 73 | virtual bool |
michael@0 | 74 | HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE; |
michael@0 | 75 | |
michael@0 | 76 | virtual void |
michael@0 | 77 | ShutdownTransactionService() MOZ_OVERRIDE; |
michael@0 | 78 | |
michael@0 | 79 | private: |
michael@0 | 80 | nsresult |
michael@0 | 81 | GetDirectory(PersistenceType aPersistenceType, const nsACString& aOrigin, |
michael@0 | 82 | nsIFile** aDirectory); |
michael@0 | 83 | |
michael@0 | 84 | nsresult |
michael@0 | 85 | GetUsageForDirectoryInternal(nsIFile* aDirectory, |
michael@0 | 86 | UsageInfo* aUsageInfo, |
michael@0 | 87 | bool aDatabaseFiles); |
michael@0 | 88 | |
michael@0 | 89 | nsAutoRefCnt mRefCnt; |
michael@0 | 90 | NS_DECL_OWNINGTHREAD |
michael@0 | 91 | }; |
michael@0 | 92 | |
michael@0 | 93 | END_INDEXEDDB_NAMESPACE |
michael@0 | 94 | |
michael@0 | 95 | #endif // mozilla_dom_indexeddb_client_h__ |