Bug 1483965 - Fix the checked selection in the RDM device pixel ratio menu. r=caliman
[gecko.git] / xpcom / ds / nsPersistentProperties.h
blob5e280d377f472d5dd9fbfa6cfe7f8acac3029d8a
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"
12 #include "nsString.h"
13 #include "nsCOMPtr.h"
14 #include "mozilla/ArenaAllocator.h"
15 #include "mozilla/Attributes.h"
17 class nsIUnicharInputStream;
19 class nsPersistentProperties final : public nsIPersistentProperties
21 public:
22 nsPersistentProperties();
24 NS_DECL_THREADSAFE_ISUPPORTS
25 NS_DECL_NSIPROPERTIES
26 NS_DECL_NSIPERSISTENTPROPERTIES
28 static MOZ_MUST_USE nsresult
29 Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
31 size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override;
33 private:
34 ~nsPersistentProperties();
36 protected:
37 nsCOMPtr<nsIUnicharInputStream> mIn;
39 PLDHashTable mTable;
40 mozilla::ArenaAllocator<2048,4> mArena;
43 class nsPropertyElement final : public nsIPropertyElement
45 public:
46 nsPropertyElement()
50 nsPropertyElement(const nsACString& aKey, const nsAString& aValue)
51 : mKey(aKey)
52 , mValue(aValue)
56 NS_DECL_ISUPPORTS
57 NS_DECL_NSIPROPERTYELEMENT
59 static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult);
61 private:
62 ~nsPropertyElement() {}
64 protected:
65 nsCString mKey;
66 nsString mValue;
69 #endif /* nsPersistentProperties_h___ */