diff options
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 |