1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/indexedDB/Client.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,95 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=2 et sw=2 tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef mozilla_dom_indexeddb_client_h__ 1.11 +#define mozilla_dom_indexeddb_client_h__ 1.12 + 1.13 +#include "IndexedDatabase.h" 1.14 + 1.15 +#include "mozilla/dom/quota/Client.h" 1.16 + 1.17 +#define JOURNAL_DIRECTORY_NAME "journals" 1.18 + 1.19 +BEGIN_INDEXEDDB_NAMESPACE 1.20 + 1.21 +class Client : public mozilla::dom::quota::Client 1.22 +{ 1.23 + typedef mozilla::dom::quota::OriginOrPatternString OriginOrPatternString; 1.24 + typedef mozilla::dom::quota::PersistenceType PersistenceType; 1.25 + typedef mozilla::dom::quota::UsageInfo UsageInfo; 1.26 + 1.27 +public: 1.28 + NS_IMETHOD_(MozExternalRefCountType) 1.29 + AddRef() MOZ_OVERRIDE; 1.30 + 1.31 + NS_IMETHOD_(MozExternalRefCountType) 1.32 + Release() MOZ_OVERRIDE; 1.33 + 1.34 + virtual Type 1.35 + GetType() MOZ_OVERRIDE 1.36 + { 1.37 + return IDB; 1.38 + } 1.39 + 1.40 + virtual nsresult 1.41 + InitOrigin(PersistenceType aPersistenceType, 1.42 + const nsACString& aGroup, 1.43 + const nsACString& aOrigin, 1.44 + UsageInfo* aUsageInfo) MOZ_OVERRIDE; 1.45 + 1.46 + virtual nsresult 1.47 + GetUsageForOrigin(PersistenceType aPersistenceType, 1.48 + const nsACString& aGroup, 1.49 + const nsACString& aOrigin, 1.50 + UsageInfo* aUsageInfo) MOZ_OVERRIDE; 1.51 + 1.52 + virtual void 1.53 + OnOriginClearCompleted(PersistenceType aPersistenceType, 1.54 + const OriginOrPatternString& aOriginOrPattern) 1.55 + MOZ_OVERRIDE; 1.56 + 1.57 + virtual void 1.58 + ReleaseIOThreadObjects() MOZ_OVERRIDE; 1.59 + 1.60 + virtual bool 1.61 + IsFileServiceUtilized() MOZ_OVERRIDE 1.62 + { 1.63 + return true; 1.64 + } 1.65 + 1.66 + virtual bool 1.67 + IsTransactionServiceActivated() MOZ_OVERRIDE; 1.68 + 1.69 + virtual void 1.70 + WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages, 1.71 + nsIRunnable* aCallback) MOZ_OVERRIDE; 1.72 + 1.73 + virtual void 1.74 + AbortTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE; 1.75 + 1.76 + virtual bool 1.77 + HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE; 1.78 + 1.79 + virtual void 1.80 + ShutdownTransactionService() MOZ_OVERRIDE; 1.81 + 1.82 +private: 1.83 + nsresult 1.84 + GetDirectory(PersistenceType aPersistenceType, const nsACString& aOrigin, 1.85 + nsIFile** aDirectory); 1.86 + 1.87 + nsresult 1.88 + GetUsageForDirectoryInternal(nsIFile* aDirectory, 1.89 + UsageInfo* aUsageInfo, 1.90 + bool aDatabaseFiles); 1.91 + 1.92 + nsAutoRefCnt mRefCnt; 1.93 + NS_DECL_OWNINGTHREAD 1.94 +}; 1.95 + 1.96 +END_INDEXEDDB_NAMESPACE 1.97 + 1.98 +#endif // mozilla_dom_indexeddb_client_h__