Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / dom / quota / QuotaResults.cpp
blobffa3d92e3b221d1eebe7de58a8b6f60bafff4bc8
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/. */
7 #include "QuotaResults.h"
9 #include "ErrorList.h"
10 #include "mozilla/Assertions.h"
11 #include "mozilla/MacroForEach.h"
12 #include "nscore.h"
14 namespace mozilla::dom::quota {
16 UsageResult::UsageResult(const nsACString& aOrigin, bool aPersisted,
17 uint64_t aUsage, uint64_t aLastAccessed)
18 : mOrigin(aOrigin),
19 mUsage(aUsage),
20 mPersisted(aPersisted),
21 mLastAccessed(aLastAccessed) {}
23 NS_IMPL_ISUPPORTS(UsageResult, nsIQuotaUsageResult)
25 NS_IMETHODIMP
26 UsageResult::GetOrigin(nsACString& aOrigin) {
27 aOrigin = mOrigin;
28 return NS_OK;
31 NS_IMETHODIMP
32 UsageResult::GetPersisted(bool* aPersisted) {
33 MOZ_ASSERT(aPersisted);
35 *aPersisted = mPersisted;
36 return NS_OK;
39 NS_IMETHODIMP
40 UsageResult::GetUsage(uint64_t* aUsage) {
41 MOZ_ASSERT(aUsage);
43 *aUsage = mUsage;
44 return NS_OK;
47 NS_IMETHODIMP
48 UsageResult::GetLastAccessed(uint64_t* aLastAccessed) {
49 MOZ_ASSERT(aLastAccessed);
51 *aLastAccessed = mLastAccessed;
52 return NS_OK;
55 OriginUsageResult::OriginUsageResult(uint64_t aUsage, uint64_t aFileUsage)
56 : mUsage(aUsage), mFileUsage(aFileUsage) {}
58 NS_IMPL_ISUPPORTS(OriginUsageResult, nsIQuotaOriginUsageResult)
60 NS_IMETHODIMP
61 OriginUsageResult::GetUsage(uint64_t* aUsage) {
62 MOZ_ASSERT(aUsage);
64 *aUsage = mUsage;
65 return NS_OK;
68 NS_IMETHODIMP
69 OriginUsageResult::GetFileUsage(uint64_t* aFileUsage) {
70 MOZ_ASSERT(aFileUsage);
72 *aFileUsage = mFileUsage;
73 return NS_OK;
76 EstimateResult::EstimateResult(uint64_t aUsage, uint64_t aLimit)
77 : mUsage(aUsage), mLimit(aLimit) {}
79 NS_IMPL_ISUPPORTS(EstimateResult, nsIQuotaEstimateResult)
81 NS_IMETHODIMP
82 EstimateResult::GetUsage(uint64_t* aUsage) {
83 MOZ_ASSERT(aUsage);
85 *aUsage = mUsage;
86 return NS_OK;
89 NS_IMETHODIMP
90 EstimateResult::GetLimit(uint64_t* aLimit) {
91 MOZ_ASSERT(aLimit);
93 *aLimit = mLimit;
94 return NS_OK;
97 } // namespace mozilla::dom::quota