Bug 1834993 - Fix nursery allocatable flag for objects with foreground finalizers...
[gecko.git] / dom / quota / ClientUsageArray.h
blob3b57656143f36876f462a5699fea4c9cd507351a
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_QUOTA_CLIENTUSAGEARAY_H_
8 #define DOM_QUOTA_CLIENTUSAGEARAY_H_
10 #include <cstdint>
11 #include "mozilla/Maybe.h"
12 #include "mozilla/dom/quota/Client.h"
14 namespace mozilla::dom::quota {
16 // XXX Change this not to derive from AutoTArray.
17 class ClientUsageArray final
18 : public AutoTArray<Maybe<uint64_t>, Client::TYPE_MAX> {
19 public:
20 ClientUsageArray() { SetLength(Client::TypeMax()); }
22 void Serialize(nsACString& aText) const;
24 nsresult Deserialize(const nsACString& aText);
26 ClientUsageArray Clone() const {
27 ClientUsageArray res;
28 res.Assign(*this);
29 return res;
33 } // namespace mozilla::dom::quota
35 #endif // DOM_QUOTA_CLIENTUSAGEARAY_H_