tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

QuotaResults.h (1944B)


      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 
     12 #include "mozilla/dom/quota/CommonMetadata.h"
     13 #include "mozilla/dom/quota/UsageInfo.h"
     14 #include "nsIQuotaResults.h"
     15 #include "nsISupports.h"
     16 #include "nsString.h"
     17 
     18 namespace mozilla::dom::quota {
     19 
     20 class FullOriginMetadataResult : public nsIQuotaFullOriginMetadataResult {
     21  const FullOriginMetadata mFullOriginMetadata;
     22 
     23 public:
     24  explicit FullOriginMetadataResult(
     25      const FullOriginMetadata& aFullOriginMetadata);
     26 
     27 private:
     28  virtual ~FullOriginMetadataResult() = default;
     29 
     30  NS_DECL_ISUPPORTS
     31  NS_DECL_NSIQUOTAFULLORIGINMETADATARESULT
     32 };
     33 
     34 class UsageResult : public nsIQuotaUsageResult {
     35  nsCString mOrigin;
     36  uint64_t mUsage;
     37  bool mPersisted;
     38  uint64_t mLastAccessed;
     39 
     40 public:
     41  UsageResult(const nsACString& aOrigin, bool aPersisted, uint64_t aUsage,
     42              uint64_t aLastAccessed);
     43 
     44 private:
     45  virtual ~UsageResult() = default;
     46 
     47  NS_DECL_ISUPPORTS
     48  NS_DECL_NSIQUOTAUSAGERESULT
     49 };
     50 
     51 class OriginUsageResult : public nsIQuotaOriginUsageResult {
     52  UsageInfo mUsageInfo;
     53 
     54 public:
     55  explicit OriginUsageResult(UsageInfo aUsageInfo);
     56 
     57 private:
     58  virtual ~OriginUsageResult() = default;
     59 
     60  NS_DECL_ISUPPORTS
     61  NS_DECL_NSIQUOTAORIGINUSAGERESULT
     62 };
     63 
     64 class EstimateResult : public nsIQuotaEstimateResult {
     65  uint64_t mUsage;
     66  uint64_t mLimit;
     67 
     68 public:
     69  EstimateResult(uint64_t aUsage, uint64_t aLimit);
     70 
     71 private:
     72  virtual ~EstimateResult() = default;
     73 
     74  NS_DECL_ISUPPORTS
     75  NS_DECL_NSIQUOTAESTIMATERESULT
     76 };
     77 
     78 }  // namespace mozilla::dom::quota
     79 
     80 #endif  // mozilla_dom_quota_QuotaResults_h