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 #ifndef nsPersistentProperties_h___
8 #define nsPersistentProperties_h___
10 #include "nsIPersistentProperties2.h"
11 #include "PLDHashTable.h"
14 #include "mozilla/ArenaAllocator.h"
15 #include "mozilla/Attributes.h"
17 class nsIUnicharInputStream
;
19 class nsPersistentProperties final
: public nsIPersistentProperties
{
21 nsPersistentProperties();
23 NS_DECL_THREADSAFE_ISUPPORTS
25 NS_DECL_NSIPERSISTENTPROPERTIES
27 size_t SizeOfIncludingThis(
28 mozilla::MallocSizeOf aMallocSizeOf
) const override
;
31 ~nsPersistentProperties();
34 nsCOMPtr
<nsIUnicharInputStream
> mIn
;
37 mozilla::ArenaAllocator
<2048, 4> mArena
;
40 class nsPropertyElement final
: public nsIPropertyElement
{
42 nsPropertyElement() = default;
44 nsPropertyElement(const nsACString
& aKey
, const nsAString
& aValue
)
45 : mKey(aKey
), mValue(aValue
) {}
48 NS_DECL_NSIPROPERTYELEMENT
50 static nsresult
Create(nsISupports
* aOuter
, REFNSIID aIID
, void** aResult
);
53 ~nsPropertyElement() = default;
60 #endif /* nsPersistentProperties_h___ */