From def92d1b8e9d373e2f6f27c366d578d97d8960c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:50 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- gfx/thebes/gfxUserFontSet.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gfx/thebes/gfxUserFontSet.h') diff --git a/gfx/thebes/gfxUserFontSet.h b/gfx/thebes/gfxUserFontSet.h index d67d10fbe6..58cd2a077f 100644 --- a/gfx/thebes/gfxUserFontSet.h +++ b/gfx/thebes/gfxUserFontSet.h @@ -11,9 +11,11 @@ #include "gfxFontEntry.h" #include "gfxFontUtils.h" #include "mozilla/AlreadyAddRefed.h" +#include "mozilla/Atomics.h" #include "mozilla/Attributes.h" #include "mozilla/FontPropertyTypes.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/RecursiveMutex.h" #include "mozilla/RefPtr.h" #include "nsCOMPtr.h" #include "nsHashKeys.h" @@ -314,7 +316,11 @@ class gfxUserFontSet { uint64_t GetGeneration() { return mGeneration; } // increment the generation on font load - void IncrementGeneration(bool aIsRebuild = false); + void IncrementGeneration(bool aIsRebuild = false) { + mozilla::RecursiveMutexAutoLock lock(mMutex); + IncrementGenerationLocked(aIsRebuild); + } + void IncrementGenerationLocked(bool aIsRebuild = false) MOZ_REQUIRES(mMutex); // Generation is bumped on font loads but that doesn't affect name-style // mappings. Rebuilds do however affect name-style mappings so need to @@ -520,6 +526,9 @@ class gfxUserFontSet { // helper method for performing the actual userfont set rebuild virtual void DoRebuildUserFontSet() = 0; + // forget about a loader that has been cancelled + virtual void RemoveLoader(nsFontFaceLoader* aLoader) = 0; + // helper method for FindOrCreateUserFontEntry gfxUserFontEntry* FindExistingUserFontEntry( gfxUserFontFamily* aFamily, @@ -548,6 +557,8 @@ class gfxUserFontSet { // performance stats uint32_t mDownloadCount; uint64_t mDownloadSize; + + mutable mozilla::RecursiveMutex mMutex; }; // acts a placeholder until the real font is downloaded -- cgit v1.2.3