bug 665360 - hold reference to font family from loader. r=jdaggett
authorJonathan Kew <jfkthame@gmail.com>
Tue, 09 Aug 2011 08:51:46 +0100
changeset 74086 89842a2a40c66e1cdd92399950a3274b0c41a0b8
parent 74085 d39783167bb97a9d0b61ed728ce103fcfa9cfadf
child 74087 c433a1d53dd565b9d07635f4698f971e19312461
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersjdaggett
bugs665360
milestone8.0a1
bug 665360 - hold reference to font family from loader. r=jdaggett
layout/style/nsFontFaceLoader.cpp
layout/style/nsFontFaceLoader.h
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -87,16 +87,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
@@ -140,16 +140,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;
 };