Bug 1273409 - add assert for mFontEntry. r?jrmuizel draft
authorAndi-Bogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 17 May 2016 12:05:23 +0300
changeset 367708 bd613cb895912cc3a5047001311485bb6856d84c
parent 367573 a884b96685aa13b65601feddb24e5f85ba861561
child 521089 929124f168abb071e800c4244e47e0bfbd918786
push id18331
push userBogdan.Postelnicu@softvision.ro
push dateTue, 17 May 2016 09:06:37 +0000
reviewersjrmuizel
bugs1273409
milestone49.0a1
Bug 1273409 - add assert for mFontEntry. r?jrmuizel MozReview-Commit-ID: 645INbJtJFq
gfx/thebes/gfxUserFontSet.cpp
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -1300,25 +1300,24 @@ gfxUserFontSet::UserFontCache::Shutdown(
 
 MOZ_DEFINE_MALLOC_SIZE_OF(UserFontsMallocSizeOf)
 
 nsresult
 gfxUserFontSet::UserFontCache::Entry::ReportMemory(nsIMemoryReporterCallback* aCb,
                                                    nsISupports* aClosure,
                                                    bool aAnonymize)
 {
+    MOZ_ASSERT(mFontEntry);
     nsAutoCString path("explicit/gfx/user-fonts/font(");
 
     if (aAnonymize) {
         path.AppendPrintf("<anonymized-%p>", this);
     } else {
-        if (mFontEntry) { // this should always be present
-            NS_ConvertUTF16toUTF8 familyName(mFontEntry->mFamilyName);
-            path.AppendPrintf("family=%s", familyName.get());
-        }
+        NS_ConvertUTF16toUTF8 familyName(mFontEntry->mFamilyName);
+        path.AppendPrintf("family=%s", familyName.get());
         if (mURI) {
             nsCString spec;
             mURI->GetSpec(spec);
             spec.ReplaceChar('/', '\\');
             // Some fonts are loaded using horrendously-long data: URIs;
             // truncate those before reporting them.
             bool isData;
             if (NS_SUCCEEDED(mURI->SchemeIs("data", &isData)) && isData &&