bug 665360 - hold reference to font family from loader. r=jdaggett a=jst
authorJonathan Kew <jfkthame@gmail.com>
Tue, 23 Aug 2011 09:39:34 +0100
changeset 73047 b8d41ea97ce8415e187829ee132899749092b755
parent 73046 7b2999dd88b923694d8cc546d29df4064bef076d
child 73048 246e03c5d04fa0d9096fdb20538c14817910423b
push id168
push userjkew@mozilla.com
push dateTue, 23 Aug 2011 08:41:45 +0000
treeherdermozilla-beta@b8d41ea97ce8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett, jst
bugs665360
milestone7.0
bug 665360 - hold reference to font family from loader. r=jdaggett a=jst
layout/style/nsFontFaceLoader.cpp
layout/style/nsFontFaceLoader.h
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -85,16 +85,17 @@ static PRLogModuleInfo *gFontDownloaderL
 #define LOG_ENABLED() PR_LOG_TEST(gFontDownloaderLog, PR_LOG_DEBUG)
 
 
 nsFontFaceLoader::nsFontFaceLoader(gfxProxyFontEntry *aProxy, nsIURI *aFontURI,
                                    nsUserFontSet *aFontSet, nsIChannel *aChannel)
   : mFontEntry(aProxy), mFontURI(aFontURI), mFontSet(aFontSet),
     mChannel(aChannel)
 {
+  mFontFamily = aProxy->Family();
 }
 
 nsFontFaceLoader::~nsFontFaceLoader()
 {
   if (mLoadTimer) {
     mLoadTimer->Cancel();
     mLoadTimer = nsnull;
   }
--- a/layout/style/nsFontFaceLoader.h
+++ b/layout/style/nsFontFaceLoader.h
@@ -135,16 +135,17 @@ public:
   static void LoadTimerCallback(nsITimer *aTimer, void *aClosure);
 
   static nsresult CheckLoadAllowed(nsIPrincipal* aSourcePrincipal,
                                    nsIURI* aTargetURI,
                                    nsISupports* aContext);
 
 private:
   nsRefPtr<gfxProxyFontEntry>  mFontEntry;
+  nsRefPtr<gfxFontFamily>      mFontFamily;
   nsCOMPtr<nsIURI>        mFontURI;
   nsRefPtr<nsUserFontSet> mFontSet;
   nsCOMPtr<nsIChannel>    mChannel;
   nsCOMPtr<nsITimer>      mLoadTimer;
 
   nsIStreamLoader        *mStreamLoader;
 };