Bug 1167697 - Mark refs to gfxFontEntry in UserFontCache as MOZ_NON_OWNING_REF. r=jtd
authorMichael Layzell <michael@thelayzells.com>
Fri, 22 May 2015 11:47:00 -0400
changeset 279991 2672dbf9be5d562fdd045d6fe16edd21982edc60
parent 279990 0cc0541804753740ac22c87d034a255c77d74ece
child 279992 60d7b4ba9e03b5083d6d1da7e6c36a9b8b1830e5
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjtd
bugs1167697
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1167697 - Mark refs to gfxFontEntry in UserFontCache as MOZ_NON_OWNING_REF. r=jtd
gfx/thebes/gfxUserFontSet.h
--- a/gfx/thebes/gfxUserFontSet.h
+++ b/gfx/thebes/gfxUserFontSet.h
@@ -333,17 +333,19 @@ public:
         // Note that key comparison does *not* use the mFontEntry field
         // as a whole; it only compares specific fields within the entry
         // (weight/width/style/features) that could affect font selection
         // or rendering, and that must match between a font-set's userfont
         // entry and the corresponding "real" font entry.
         struct Key {
             nsCOMPtr<nsIURI>        mURI;
             nsCOMPtr<nsIPrincipal>  mPrincipal; // use nullptr with data: URLs
-            gfxFontEntry*           mFontEntry;
+            // The font entry MUST notify the cache when it is destroyed
+            // (by calling ForgetFont()).
+            gfxFontEntry* MOZ_NON_OWNING_REF mFontEntry;
             uint32_t                mCRC32;
             uint32_t                mLength;
             bool                    mPrivate;
             EntryPersistence        mPersistence;
 
             Key(nsIURI* aURI, nsIPrincipal* aPrincipal,
                 gfxFontEntry* aFontEntry, bool aPrivate,
                 EntryPersistence aPersistence = kDiscardable)
@@ -445,18 +447,18 @@ public:
             nsCOMPtr<nsIURI>       mURI;
             nsCOMPtr<nsIPrincipal> mPrincipal; // or nullptr for data: URLs
 
             uint32_t               mCRC32;
             uint32_t               mLength;
 
             // The "real" font entry corresponding to this downloaded font.
             // The font entry MUST notify the cache when it is destroyed
-            // (by calling Forget()).
-            gfxFontEntry*          mFontEntry;
+            // (by calling ForgetFont()).
+            gfxFontEntry* MOZ_NON_OWNING_REF mFontEntry;
 
             // Whether this font was loaded from a private window.
             bool                   mPrivate;
 
             // Whether this entry should survive cache-flushing.
             EntryPersistence       mPersistence;
         };