Bug 1031187 - Part 2: Use family name from proxy rather than gfxMixedFontFamily when logging. r=jdaggett
authorCameron McCormack <cam@mcc.id.au>
Wed, 09 Jul 2014 17:08:55 +1000
changeset 214036 df4473d66d3845ae7afc2e83bdab41202f8ba088
parent 214035 9ec5db6a1684276d922d3a640dc809c952959870
child 214037 8214bea32abb78ccf24ce9bf1e8ae1cc43c39db4
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs1031187
milestone33.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 1031187 - Part 2: Use family name from proxy rather than gfxMixedFontFamily when logging. r=jdaggett
gfx/thebes/gfxUserFontSet.cpp
layout/style/nsFontFaceLoader.cpp
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -346,32 +346,32 @@ gfxProxyFontEntry::LoadNext(gfxMixedFont
             gfxFontEntry *fe =
                 gfxPlatform::GetPlatform()->LookupLocalFont(this,
                                                             currSrc.mLocalName);
             aLocalRulesUsed = true;
             if (fe) {
                 LOG(("fontset (%p) [src %d] loaded local: (%s) for (%s) gen: %8.8x\n",
                      mFontSet, mSrcIndex,
                      NS_ConvertUTF16toUTF8(currSrc.mLocalName).get(),
-                     NS_ConvertUTF16toUTF8(aFamily->Name()).get(),
+                     NS_ConvertUTF16toUTF8(mFamilyName).get(),
                      uint32_t(mFontSet->mGeneration)));
                 fe->mFeatureSettings.AppendElements(mFeatureSettings);
                 fe->mLanguageOverride = mLanguageOverride;
                 fe->mFamilyName = mFamilyName;
                 // For src:local(), we don't care whether the request is from
                 // a private window as there's no issue of caching resources;
                 // local fonts are just available all the time.
                 StoreUserFontData(fe, false, nsString(), nullptr, 0);
                 mFontSet->ReplaceFontEntry(aFamily, this, fe);
                 return STATUS_LOADED;
             } else {
                 LOG(("fontset (%p) [src %d] failed local: (%s) for (%s)\n",
                      mFontSet, mSrcIndex,
                      NS_ConvertUTF16toUTF8(currSrc.mLocalName).get(),
-                     NS_ConvertUTF16toUTF8(aFamily->Name()).get()));
+                     NS_ConvertUTF16toUTF8(mFamilyName).get()));
             }
         }
 
         // src url ==> start the load process
         else {
             if (gfxPlatform::GetPlatform()->IsFontFormatSupported(currSrc.mURI,
                     currSrc.mFormatFlags)) {
 
@@ -429,17 +429,17 @@ gfxProxyFontEntry::LoadNext(gfxMixedFont
 
                         if (loadOK) {
 #ifdef PR_LOGGING
                             if (LOG_ENABLED()) {
                                 nsAutoCString fontURI;
                                 currSrc.mURI->GetSpec(fontURI);
                                 LOG(("userfonts (%p) [src %d] loading uri: (%s) for (%s)\n",
                                      mFontSet, mSrcIndex, fontURI.get(),
-                                     NS_ConvertUTF16toUTF8(aFamily->Name()).get()));
+                                     NS_ConvertUTF16toUTF8(mFamilyName).get()));
                             }
 #endif
                             return STATUS_LOADING;
                         } else {
                             mFontSet->LogMessage(aFamily, this,
                                                  "download failed",
                                                  nsIScriptError::errorFlag,
                                                  rv);
@@ -461,17 +461,17 @@ gfxProxyFontEntry::LoadNext(gfxMixedFont
 
     if (mUnsupportedFormat) {
         mFontSet->LogMessage(aFamily, this, "no supported format found",
                              nsIScriptError::warningFlag);
     }
 
     // all src's failed; mark this entry as unusable (so fallback will occur)
     LOG(("userfonts (%p) failed all src for (%s)\n",
-        mFontSet, NS_ConvertUTF16toUTF8(aFamily->Name()).get()));
+        mFontSet, NS_ConvertUTF16toUTF8(mFamilyName).get()));
     mLoadingState = LOADING_FAILED;
 
     return STATUS_END_OF_LIST;
 }
 
 gfxFontEntry*
 gfxProxyFontEntry::LoadFont(gfxMixedFontFamily *aFamily,
                             const uint8_t *aFontData, uint32_t &aLength)
@@ -533,31 +533,31 @@ gfxProxyFontEntry::LoadFont(gfxMixedFont
         StoreUserFontData(fe, mFontSet->GetPrivateBrowsing(), originalFullName,
                           &metadata, metaOrigLen);
 #ifdef PR_LOGGING
         if (LOG_ENABLED()) {
             nsAutoCString fontURI;
             mSrcList[mSrcIndex].mURI->GetSpec(fontURI);
             LOG(("userfonts (%p) [src %d] loaded uri: (%s) for (%s) gen: %8.8x\n",
                  this, mSrcIndex, fontURI.get(),
-                 NS_ConvertUTF16toUTF8(aFamily->Name()).get(),
+                 NS_ConvertUTF16toUTF8(mFamilyName).get(),
                  uint32_t(mFontSet->mGeneration)));
         }
 #endif
         mFontSet->ReplaceFontEntry(aFamily, this, fe);
         gfxUserFontSet::UserFontCache::CacheFont(fe);
     } else {
 #ifdef PR_LOGGING
         if (LOG_ENABLED()) {
             nsAutoCString fontURI;
             mSrcList[mSrcIndex].mURI->GetSpec(fontURI);
             LOG(("userfonts (%p) [src %d] failed uri: (%s) for (%s)"
                  " error making platform font\n",
                  this, mSrcIndex, fontURI.get(),
-                 NS_ConvertUTF16toUTF8(aFamily->Name()).get()));
+                 NS_ConvertUTF16toUTF8(mFamilyName).get()));
         }
 #endif
     }
 
     // The downloaded data can now be discarded; the font entry is using the
     // sanitized copy
     NS_Free((void*)aFontData);
 
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -769,17 +769,17 @@ nsUserFontSet::LogMessage(gfxMixedFontFa
                           nsresult          aStatus)
 {
   nsCOMPtr<nsIConsoleService>
     console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
   if (!console) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
-  NS_ConvertUTF16toUTF8 familyName(aFamily->Name());
+  NS_ConvertUTF16toUTF8 familyName(aProxy->mFamilyName);
   nsAutoCString fontURI;
   if (aProxy->mSrcIndex == aProxy->mSrcList.Length()) {
     fontURI.AppendLiteral("(end of source list)");
   } else {
     if (aProxy->mSrcList[aProxy->mSrcIndex].mURI) {
       aProxy->mSrcList[aProxy->mSrcIndex].mURI->GetSpec(fontURI);
     } else {
       fontURI.AppendLiteral("(invalid URI)");