diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /gfx/thebes/gfxUserFontSet.h | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/gfxUserFontSet.h')
-rw-r--r-- | gfx/thebes/gfxUserFontSet.h | 13 |
1 files changed, 12 insertions, 1 deletions
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 |