Bug 1420680: Remove the user font cache generation, which is also unused now. r?jfkthame draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 23 Mar 2018 18:09:09 +0100
changeset 771993 f2dd14ef816f02a2333fe62cdd3fba870eee288c
parent 771992 3a4199b30530b866ac5420bffab1e64a2113461a
child 771996 9ab58656478fc5d2aaf095174d8e168db6e32939
push id103820
push userbmo:emilio@crisal.io
push dateSat, 24 Mar 2018 13:51:22 +0000
reviewersjfkthame
bugs1420680
milestone61.0a1
Bug 1420680: Remove the user font cache generation, which is also unused now. r?jfkthame MozReview-Commit-ID: HuQg4RopOmX
gfx/thebes/gfxUserFontSet.cpp
gfx/thebes/gfxUserFontSet.h
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -1121,19 +1121,16 @@ gfxUserFontSet::GetFamily(const nsAStrin
 // tracker (gfxFontCache). The result is that the downloaded font instances
 // recorded here will persist between pages and can get reused (provided the
 // source URI and principal match, of course).
 ///////////////////////////////////////////////////////////////////////////////
 
 nsTHashtable<gfxUserFontSet::UserFontCache::Entry>*
 gfxUserFontSet::UserFontCache::sUserFonts = nullptr;
 
-uint32_t
-gfxUserFontSet::UserFontCache::sGeneration = 0;
-
 NS_IMPL_ISUPPORTS(gfxUserFontSet::UserFontCache::Flusher, nsIObserver)
 
 NS_IMETHODIMP
 gfxUserFontSet::UserFontCache::Flusher::Observe(nsISupports* aSubject,
                                                 const char* aTopic,
                                                 const char16_t* aData)
 {
     if (!sUserFonts) {
@@ -1244,18 +1241,16 @@ gfxUserFontSet::UserFontCache::CacheFont
     if (IgnorePrincipal(data->mURI)) {
         principal = nullptr;
     } else {
         principal = data->mPrincipal;
     }
     sUserFonts->PutEntry(Key(data->mURI, principal, aFontEntry,
                              data->mPrivate));
 
-    ++sGeneration;
-
 #ifdef DEBUG_USERFONT_CACHE
     printf("userfontcache added fontentry: %p\n", aFontEntry);
     Dump();
 #endif
 }
 
 void
 gfxUserFontSet::UserFontCache::ForgetFont(gfxFontEntry* aFontEntry)
--- a/gfx/thebes/gfxUserFontSet.h
+++ b/gfx/thebes/gfxUserFontSet.h
@@ -312,20 +312,16 @@ public:
 
         // Return the gfxFontEntry corresponding to a given URI and principal,
         // and the features of the given userfont entry, or nullptr if none is available.
         // The aPrivate flag is set for requests coming from private windows,
         // so we can avoid leaking fonts cached in private windows mode out to
         // normal windows.
         static gfxFontEntry* GetFont(const gfxFontFaceSrc&, const gfxUserFontEntry&);
 
-        // Generation number that is incremented whenever an entry is added to
-        // the cache.  (Removals don't increment it.)
-        static uint32_t Generation() { return sGeneration; }
-
         // Clear everything so that we don't leak URIs and Principals.
         static void Shutdown();
 
         // Memory-reporting support.
         class MemoryReporter final : public nsIMemoryReporter
         {
         private:
             ~MemoryReporter() { }
@@ -449,18 +445,16 @@ public:
             // (by calling ForgetFont()).
             gfxFontEntry* MOZ_NON_OWNING_REF mFontEntry;
 
             // Whether this font was loaded from a private window.
             bool                   mPrivate;
         };
 
         static nsTHashtable<Entry>* sUserFonts;
-
-        static uint32_t sGeneration;
     };
 
     void SetLocalRulesUsed() {
         mLocalRulesUsed = true;
     }
 
     static mozilla::LogModule* GetUserFontsLog();