diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/canvas/CacheInvalidator.h | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/canvas/CacheInvalidator.h')
-rw-r--r-- | dom/canvas/CacheInvalidator.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/dom/canvas/CacheInvalidator.h b/dom/canvas/CacheInvalidator.h index e63f1e4cc2..909aacfc37 100644 --- a/dom/canvas/CacheInvalidator.h +++ b/dom/canvas/CacheInvalidator.h @@ -9,8 +9,7 @@ #include "mozilla/Maybe.h" #include "mozilla/UniquePtr.h" -#include <unordered_map> -#include <unordered_set> +#include "DmdStdContainers.h" #include <vector> // - @@ -25,7 +24,7 @@ class CacheInvalidator { friend class AbstractCache; private: - mutable std::unordered_set<AbstractCache*> mCaches; + mutable webgl::dmd_unordered_set<AbstractCache*> mCaches; public: virtual ~CacheInvalidator() { @@ -38,6 +37,12 @@ class CacheInvalidator { } void InvalidateCaches() const; + + // - + + size_t SizeOfExcludingThis(mozilla::MallocSizeOf mso) const { + return mCaches.SizeOfExcludingThis(mso); + } }; // - @@ -122,11 +127,15 @@ class CacheWeakMap final { } }; - using MapT = - std::unordered_map<const KeyT*, UniquePtr<Entry>, DerefHash, DerefEqual>; + using MapT = webgl::dmd_unordered_map<const KeyT*, UniquePtr<Entry>, + DerefHash, DerefEqual>; MapT mMap; public: + size_t SizeOfExcludingThis(mozilla::MallocSizeOf mso) const { + return mMap.SizeOfExcludingThis(mso); + } + UniquePtr<Entry> MakeEntry(const KeyT& key, ValueT&& value) { return UniquePtr<Entry>(new Entry(*this, key, std::move(value))); } |