1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=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 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_dom_quota_QuotaResults_h 8 #define mozilla_dom_quota_QuotaResults_h 9 10 #include <cstdint> 11 #include "nsIQuotaResults.h" 12 #include "nsISupports.h" 13 #include "nsString.h" 14 15 namespace mozilla { 16 namespace dom { 17 namespace quota { 18 19 class UsageResult : public nsIQuotaUsageResult { 20 nsCString mOrigin; 21 uint64_t mUsage; 22 bool mPersisted; 23 uint64_t mLastAccessed; 24 25 public: 26 UsageResult(const nsACString& aOrigin, bool aPersisted, uint64_t aUsage, 27 uint64_t aLastAccessed); 28 29 private: 30 virtual ~UsageResult() = default; 31 32 NS_DECL_ISUPPORTS 33 NS_DECL_NSIQUOTAUSAGERESULT 34 }; 35 36 class OriginUsageResult : public nsIQuotaOriginUsageResult { 37 uint64_t mUsage; 38 uint64_t mFileUsage; 39 40 public: 41 OriginUsageResult(uint64_t aUsage, uint64_t aFileUsage); 42 43 private: 44 virtual ~OriginUsageResult() = default; 45 46 NS_DECL_ISUPPORTS 47 NS_DECL_NSIQUOTAORIGINUSAGERESULT 48 }; 49 50 class EstimateResult : public nsIQuotaEstimateResult { 51 uint64_t mUsage; 52 uint64_t mLimit; 53 54 public: 55 EstimateResult(uint64_t aUsage, uint64_t aLimit); 56 57 private: 58 virtual ~EstimateResult() = default; 59 60 NS_DECL_ISUPPORTS 61 NS_DECL_NSIQUOTAESTIMATERESULT 62 }; 63 64 } // namespace quota 65 } // namespace dom 66 } // namespace mozilla 67 68 #endif // mozilla_dom_quota_QuotaResults_h 69