diff options
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))); } |