Rename nsImageLoader to nsImageLoadNotifier, since it doesn't actually load images. (Bug 322475) r+sr=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Sat, 11 Oct 2008 20:49:42 -0400
changeset 20325 7f708623bf5973c81d07f80c8e0f405fcecfd6a9
parent 20324 23eebebb8b48ba5281f21e1da4d9873f4e9de918
child 20326 c7b659c2efbab2d21801d120d81dc0f43a975c16
child 21021 01e2b22db875bc378c6668f160a7ef4630806295
push id2807
push userdbaron@mozilla.com
push dateSun, 12 Oct 2008 00:50:38 +0000
treeherdermozilla-central@53740a23fe93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs322475
milestone1.9.1b2pre
Rename nsImageLoader to nsImageLoadNotifier, since it doesn't actually load images. (Bug 322475) r+sr=bzbarsky
layout/base/Makefile.in
layout/base/nsImageLoadNotifier.cpp
layout/base/nsImageLoadNotifier.h
layout/base/nsImageLoader.cpp
layout/base/nsImageLoader.h
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
layout/generic/nsFrame.cpp
--- a/layout/base/Makefile.in
+++ b/layout/base/Makefile.in
@@ -124,17 +124,17 @@ CPPSRCS		= \
 		nsCaret.cpp \
 		nsChildIterator.cpp \
 		nsCounterManager.cpp \
 		nsDisplayList.cpp \
 		nsDocumentViewer.cpp \
 		nsFrameManager.cpp \
 		nsFrameTraversal.cpp \
 		nsGenConList.cpp \
-		nsImageLoader.cpp \
+		nsImageLoadNotifier.cpp \
 		nsLayoutDebugger.cpp \
 		nsLayoutHistoryState.cpp \
 		nsLayoutUtils.cpp \
 		nsPresContext.cpp \
 		nsPresShell.cpp \
 		nsPresState.cpp \
 		nsQuoteList.cpp \
 		nsStyleChangeList.cpp \
rename from layout/base/nsImageLoader.cpp
rename to layout/base/nsImageLoadNotifier.cpp
--- a/layout/base/nsImageLoader.cpp
+++ b/layout/base/nsImageLoadNotifier.cpp
@@ -34,17 +34,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* class to notify frames of background image loads */
 
-#include "nsImageLoader.h"
+#include "nsImageLoadNotifier.h"
 
 #include "imgILoader.h"
 
 #include "nsIURI.h"
 #include "nsILoadGroup.h"
 #include "nsNetUtil.h"
 
 #include "nsPresContext.h"
@@ -56,71 +56,73 @@
 #include "imgIContainer.h"
 
 #include "nsStyleContext.h"
 #include "nsGkAtoms.h"
 
 // Paint forcing
 #include "prenv.h"
 
-NS_IMPL_ISUPPORTS2(nsImageLoader, imgIDecoderObserver, imgIContainerObserver)
+NS_IMPL_ISUPPORTS2(nsImageLoadNotifier, imgIDecoderObserver, imgIContainerObserver)
 
-nsImageLoader::nsImageLoader(nsIFrame *aFrame, PRBool aReflowOnLoad, 
-                             nsImageLoader *aNextLoader)
+nsImageLoadNotifier::nsImageLoadNotifier(nsIFrame *aFrame,
+                                         PRBool aReflowOnLoad, 
+                                         nsImageLoadNotifier *aNextLoader)
   : mFrame(aFrame),
     mReflowOnLoad(aReflowOnLoad),
     mNextLoader(aNextLoader)
 {
 }
 
-nsImageLoader::~nsImageLoader()
+nsImageLoadNotifier::~nsImageLoadNotifier()
 {
   mFrame = nsnull;
 
   if (mRequest) {
     mRequest->Cancel(NS_ERROR_FAILURE);
   }
 }
 
-/* static */ already_AddRefed<nsImageLoader>
-nsImageLoader::Create(nsIFrame *aFrame, imgIRequest *aRequest, 
-                      PRBool aReflowOnLoad, nsImageLoader *aNextLoader)
+/* static */ already_AddRefed<nsImageLoadNotifier>
+nsImageLoadNotifier::Create(nsIFrame *aFrame, imgIRequest *aRequest, 
+                            PRBool aReflowOnLoad,
+                            nsImageLoadNotifier *aNextLoader)
 {
-  nsRefPtr<nsImageLoader> loader =
-    new nsImageLoader(aFrame, aReflowOnLoad, aNextLoader);
+  nsRefPtr<nsImageLoadNotifier> loader =
+    new nsImageLoadNotifier(aFrame, aReflowOnLoad, aNextLoader);
 
   loader->Load(aRequest);
 
   return loader.forget();
 }
 
 void
-nsImageLoader::Destroy()
+nsImageLoadNotifier::Destroy()
 {
   // Destroy the chain with only one level of recursion.
-  nsRefPtr<nsImageLoader> list = mNextLoader;
+  nsRefPtr<nsImageLoadNotifier> list = mNextLoader;
   mNextLoader = nsnull;
   while (list) {
-    nsRefPtr<nsImageLoader> todestroy = list;
+    nsRefPtr<nsImageLoadNotifier> todestroy = list;
     list = todestroy->mNextLoader;
     todestroy->mNextLoader = nsnull;
     todestroy->Destroy();
   }
 
   mFrame = nsnull;
 
   if (mRequest) {
     mRequest->Cancel(NS_ERROR_FAILURE);
   }
 
   mRequest = nsnull;
 }
 
 nsresult
-nsImageLoader::Load(imgIRequest *aImage)
+nsImageLoadNotifier::Load(imgIRequest *aImage)
 {
   NS_ASSERTION(!mRequest, "can't reuse image loaders");
 
   if (!mFrame)
     return NS_ERROR_NOT_INITIALIZED;
 
   if (!aImage)
     return NS_ERROR_FAILURE;
@@ -131,35 +133,35 @@ nsImageLoader::Load(imgIRequest *aImage)
   nsCOMPtr<imgIRequest> newRequest;
   nsresult rv = aImage->Clone(this, getter_AddRefs(newRequest));
   mRequest.swap(newRequest);
   return rv;
 }
 
                     
 
-NS_IMETHODIMP nsImageLoader::OnStartContainer(imgIRequest *aRequest,
-                                              imgIContainer *aImage)
+NS_IMETHODIMP nsImageLoadNotifier::OnStartContainer(imgIRequest *aRequest,
+                                                    imgIContainer *aImage)
 {
   if (aImage)
   {
     /* Get requested animation policy from the pres context:
      *   normal = 0
      *   one frame = 1
      *   one loop = 2
      */
     aImage->SetAnimationMode(mFrame->PresContext()->ImageAnimationMode());
     // Ensure the animation (if any) is started.
     aImage->StartAnimation();
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP nsImageLoader::OnStopFrame(imgIRequest *aRequest,
-                                         gfxIImageFrame *aFrame)
+NS_IMETHODIMP nsImageLoadNotifier::OnStopFrame(imgIRequest *aRequest,
+                                               gfxIImageFrame *aFrame)
 {
   if (!mFrame)
     return NS_ERROR_FAILURE;
   
 #ifdef NS_DEBUG
 // Make sure the image request status's STATUS_FRAME_COMPLETE flag has been set to ensure
 // the image will be painted when invalidated
   if (aRequest) {
@@ -176,19 +178,19 @@ NS_IMETHODIMP nsImageLoader::OnStopFrame
     return NS_OK;
   }
   
   // Draw the background image
   RedrawDirtyFrame(nsnull);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
-                                          gfxIImageFrame *newframe,
-                                          nsRect * dirtyRect)
+NS_IMETHODIMP nsImageLoadNotifier::FrameChanged(imgIContainer *aContainer,
+                                                gfxIImageFrame *newframe,
+                                                nsRect * dirtyRect)
 {
   if (!mFrame)
     return NS_ERROR_FAILURE;
 
   if (!mRequest) {
     // We're in the middle of a paint anyway
     return NS_OK;
   }
@@ -202,17 +204,17 @@ NS_IMETHODIMP nsImageLoader::FrameChange
 
   RedrawDirtyFrame(&r);
 
   return NS_OK;
 }
 
 
 void
-nsImageLoader::RedrawDirtyFrame(const nsRect* aDamageRect)
+nsImageLoadNotifier::RedrawDirtyFrame(const nsRect* aDamageRect)
 {
   if (mReflowOnLoad) {
     nsIPresShell *shell = mFrame->PresContext()->GetPresShell();
 #ifdef DEBUG
     nsresult rv = 
 #endif
       shell->FrameNeedsReflow(mFrame, nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY);
     NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Could not reflow after loading border-image");
rename from layout/base/nsImageLoader.h
rename to layout/base/nsImageLoadNotifier.h
--- a/layout/base/nsImageLoader.h
+++ b/layout/base/nsImageLoadNotifier.h
@@ -49,27 +49,27 @@ class nsIURI;
 #include "nsAutoPtr.h"
 
 /**
  * Image loaders pass notifications for background and border image
  * loading and animation on to the frames.
  *
  * Each frame's image loaders form a linked list.
  */
-class nsImageLoader : public nsStubImageDecoderObserver
+class nsImageLoadNotifier : public nsStubImageDecoderObserver
 {
 private:
-  nsImageLoader(nsIFrame *aFrame, PRBool aReflowOnLoad,
-                nsImageLoader *aNextLoader);
-  virtual ~nsImageLoader();
+  nsImageLoadNotifier(nsIFrame *aFrame, PRBool aReflowOnLoad,
+                      nsImageLoadNotifier *aNextLoader);
+  virtual ~nsImageLoadNotifier();
 
 public:
-  static already_AddRefed<nsImageLoader>
+  static already_AddRefed<nsImageLoadNotifier>
     Create(nsIFrame *aFrame, imgIRequest *aRequest,
-           PRBool aReflowOnLoad, nsImageLoader *aNextLoader);
+           PRBool aReflowOnLoad, nsImageLoadNotifier *aNextLoader);
 
   NS_DECL_ISUPPORTS
 
   // imgIDecoderObserver (override nsStubImageDecoderObserver)
   NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);
   NS_IMETHOD OnStopFrame(imgIRequest *aRequest, gfxIImageFrame *aFrame);
   // Do not override OnDataAvailable since background images are not
   // displayed incrementally; they are displayed after the entire image
@@ -80,19 +80,19 @@ public:
   // imgIContainerObserver (override nsStubImageDecoderObserver)
   NS_IMETHOD FrameChanged(imgIContainer *aContainer, gfxIImageFrame *newframe,
                           nsRect * dirtyRect);
 
 
   void Destroy();
 
   imgIRequest *GetRequest() { return mRequest; }
-  nsImageLoader *GetNextLoader() { return mNextLoader; }
+  nsImageLoadNotifier *GetNextLoader() { return mNextLoader; }
 
 private:
   nsresult Load(imgIRequest *aImage);
   void RedrawDirtyFrame(const nsRect* aDamageRect);
 
   nsIFrame *mFrame;
   nsCOMPtr<imgIRequest> mRequest;
   PRBool mReflowOnLoad;
-  nsRefPtr<nsImageLoader> mNextLoader;
+  nsRefPtr<nsImageLoadNotifier> mNextLoader;
 };
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -44,17 +44,17 @@
 #include "nsILinkHandler.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShell.h"
 #include "nsIContentViewer.h"
 #include "nsIDocumentViewer.h"
 #include "nsPIDOMWindow.h"
 #include "nsIFocusController.h"
 #include "nsStyleSet.h"
-#include "nsImageLoader.h"
+#include "nsImageLoadNotifier.h"
 #include "nsIContent.h"
 #include "nsIFrame.h"
 #include "nsIRenderingContext.h"
 #include "nsIURL.h"
 #include "nsIDocument.h"
 #include "nsStyleContext.h"
 #include "nsILookAndFeel.h"
 #include "nsWidgetsCID.h"
@@ -145,17 +145,17 @@ IsVisualCharset(const nsCString& aCharse
   else {
     return PR_FALSE; // logical text type
   }
 }
 #endif // IBMBIDI
 
 
 static PLDHashOperator
-destroy_loads(const void * aKey, nsRefPtr<nsImageLoader>& aData, void* closure)
+destroy_notifiers(const void * aKey, nsRefPtr<nsImageLoadNotifier>& aData, void* closure)
 {
   aData->Destroy();
   return PL_DHASH_NEXT;
 }
 
 static NS_DEFINE_CID(kLookAndFeelCID,  NS_LOOKANDFEEL_CID);
 #include "nsContentCID.h"
 
@@ -226,17 +226,17 @@ nsPresContext::nsPresContext(nsIDocument
     mNeverAnimate = PR_FALSE;
   }
   NS_ASSERTION(mDocument, "Null document");
   mUserFontSet = nsnull;
 }
 
 nsPresContext::~nsPresContext()
 {
-  mImageLoaders.Enumerate(destroy_loads, nsnull);
+  mImageNotifiers.Enumerate(destroy_notifiers, nsnull);
 
   NS_PRECONDITION(!mShell, "Presshell forgot to clear our mShell pointer");
   SetShell(nsnull);
 
   if (mEventManager) {
     // unclear if these are needed, but can't hurt
     mEventManager->NotifyDestroyPresContext(this);
     mEventManager->SetPresContext(nsnull);
@@ -294,17 +294,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
    NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
    NS_INTERFACE_MAP_ENTRY(nsIObserver)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPresContext)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPresContext)
 
 static PLDHashOperator
-TraverseImageLoader(const void * aKey, nsRefPtr<nsImageLoader>& aData,
+TraverseImageNotifier(const void * aKey, nsRefPtr<nsImageLoadNotifier>& aData,
                     void* aClosure)
 {
   nsCycleCollectionTraversalCallback *cb =
     static_cast<nsCycleCollectionTraversalCallback*>(aClosure);
 
   cb->NoteXPCOMChild(aData);
 
   return PL_DHASH_NEXT;
@@ -312,17 +312,17 @@ TraverseImageLoader(const void * aKey, n
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsPresContext)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDocument);
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mDeviceContext); // worth bothering?
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mEventManager);
   // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mLookAndFeel); // a service
   // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mLangGroup); // an atom
 
-  tmp->mImageLoaders.Enumerate(TraverseImageLoader, &cb);
+  tmp->mImageNotifiers.Enumerate(TraverseImageNotifier, &cb);
 
   // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTheme); // a service
   // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLangService); // a service
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPrintSettings);
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPrefChangedTimer);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsPresContext)
@@ -334,18 +334,18 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ns
     tmp->mEventManager->SetPresContext(nsnull);
 
     NS_RELEASE(tmp->mEventManager);
   }
 
   // NS_RELEASE(tmp->mLookAndFeel); // a service
   // NS_RELEASE(tmp->mLangGroup); // an atom
 
-  tmp->mImageLoaders.Enumerate(destroy_loads, nsnull);
-  tmp->mImageLoaders.Clear();
+  tmp->mImageNotifiers.Enumerate(destroy_notifiers, nsnull);
+  tmp->mImageNotifiers.Clear();
 
   // NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTheme); // a service
   // NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mLangService); // a service
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPrintSettings);
   if (tmp->mPrefChangedTimer)
   {
     tmp->mPrefChangedTimer->Cancel();
     tmp->mPrefChangedTimer = nsnull;
@@ -808,17 +808,17 @@ nsPresContext::Init(nsIDeviceContext* aD
 
   mDeviceContext = aDeviceContext;
   NS_ADDREF(mDeviceContext);
 
   if (mDeviceContext->SetPixelScale(mFullZoom))
     mDeviceContext->FlushFontCache();
   mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
 
-  if (!mImageLoaders.Init())
+  if (!mImageNotifiers.Init())
     return NS_ERROR_OUT_OF_MEMORY;
   
   // Get the look and feel service here; default colors will be initialized
   // from calling GetUserPreferences() when we get a presshell.
   nsresult rv = CallGetService(kLookAndFeelCID, &mLookAndFeel);
   if (NS_FAILED(rv)) {
     NS_ERROR("LookAndFeel service must be implemented for this toolkit");
     return rv;
@@ -1020,19 +1020,19 @@ static void SetImgAnimModeOnImgReq(imgIR
     if (imgCon) {
       imgCon->SetAnimationMode(aMode);
     }
   }
 }
 
  // Enumeration call back for HashTable
 static PLDHashOperator
-set_animation_mode(const void * aKey, nsRefPtr<nsImageLoader>& aData, void* closure)
+set_animation_mode(const void * aKey, nsRefPtr<nsImageLoadNotifier>& aData, void* closure)
 {
-  for (nsImageLoader *loader = aData; loader;
+  for (nsImageLoadNotifier *loader = aData; loader;
        loader = loader->GetNextLoader()) {
     imgIRequest* imgReq = loader->GetRequest();
     SetImgAnimModeOnImgReq(imgReq, (PRUint16)NS_PTR_TO_INT32(closure));
   }
   return PL_DHASH_NEXT;
 }
 
 // IMPORTANT: Assumption is that all images for a Presentation 
@@ -1064,17 +1064,17 @@ nsPresContext::SetImageAnimationModeInte
                aMode == imgIContainer::kLoopOnceAnimMode, "Wrong Animation Mode is being set!");
 
   // Image animation mode cannot be changed when rendering to a printer.
   if (!IsDynamic())
     return;
 
   // This hash table contains a list of background images
   // so iterate over it and set the mode
-  mImageLoaders.Enumerate(set_animation_mode, NS_INT32_TO_PTR(aMode));
+  mImageNotifiers.Enumerate(set_animation_mode, NS_INT32_TO_PTR(aMode));
 
   // Now walk the content tree and set the animation mode 
   // on all the images
   if (mShell != nsnull) {
     nsIDocument *doc = mShell->GetDocument();
     if (doc) {
       nsIContent *rootContent = doc->GetRootContent();
       if (rootContent) {
@@ -1162,36 +1162,36 @@ nsPresContext::SetFullZoom(float aZoom)
   RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
 
   mSupressResizeReflow = PR_FALSE;
 
   mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
 }
 
 void
-nsPresContext::SetImageLoaders(nsIFrame* aTargetFrame,
-                               nsImageLoader* aImageLoaders)
+nsPresContext::SetImageNotifiers(nsIFrame* aTargetFrame,
+                                 nsImageLoadNotifier* aImageNotifiers)
 {
-  nsRefPtr<nsImageLoader> oldLoaders;
-  mImageLoaders.Get(aTargetFrame, getter_AddRefs(oldLoaders));
+  nsRefPtr<nsImageLoadNotifier> oldNotifiers;
+  mImageNotifiers.Get(aTargetFrame, getter_AddRefs(oldNotifiers));
 
-  if (aImageLoaders) {
-    mImageLoaders.Put(aTargetFrame, aImageLoaders);
-  } else if (oldLoaders) {
-    mImageLoaders.Remove(aTargetFrame);
+  if (aImageNotifiers) {
+    mImageNotifiers.Put(aTargetFrame, aImageNotifiers);
+  } else if (oldNotifiers) {
+    mImageNotifiers.Remove(aTargetFrame);
   }
 
-  if (oldLoaders)
-    oldLoaders->Destroy();
+  if (oldNotifiers)
+    oldNotifiers->Destroy();
 }
 
 void
 nsPresContext::StopImagesFor(nsIFrame* aTargetFrame)
 {
-  SetImageLoaders(aTargetFrame, nsnull);
+  SetImageNotifiers(aTargetFrame, nsnull);
 }
 
 void
 nsPresContext::SetContainer(nsISupports* aHandler)
 {
   mContainer = do_GetWeakReference(aHandler);
   if (mContainer) {
     GetDocumentColorPreferences();
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -62,17 +62,17 @@
 #include "nsIDocument.h"
 #include "nsRefPtrHashtable.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsChangeHint.h"
 // This also pulls in gfxTypes.h, which we cannot include directly.
 #include "gfxRect.h"
 #include "nsRegion.h"
 
-class nsImageLoader;
+class nsImageLoadNotifier;
 #ifdef IBMBIDI
 class nsBidiPresUtils;
 #endif // IBMBIDI
 
 struct nsRect;
 
 class imgIRequest;
 
@@ -359,18 +359,18 @@ public:
   PRUint8 GetFocusRingStyle() const { return mFocusRingStyle; }
 
 
   /**
    * Set up observers so that aTargetFrame will be invalidated when
    * aImage loads, where aImage is its background image.  Only a single
    * image will be tracked per frame.
    */
-  NS_HIDDEN_(void) SetImageLoaders(nsIFrame* aTargetFrame,
-                                   nsImageLoader* aImageLoaders);
+  NS_HIDDEN_(void) SetImageNotifiers(nsIFrame* aTargetFrame,
+                                     nsImageLoadNotifier* aImageNotifiers);
 
   /**
    * This method is called when a frame is being destroyed to
    * ensure that the image loads get disassociated from the prescontext
    */
   NS_HIDDEN_(void) StopImagesFor(nsIFrame* aTargetFrame);
 
   NS_HIDDEN_(void) SetContainer(nsISupports* aContainer);
@@ -759,17 +759,17 @@ protected:
   nsIEventStateManager* mEventManager;  // [STRONG]
   nsILookAndFeel*       mLookAndFeel;   // [STRONG]
   nsIAtom*              mMedium;        // initialized by subclass ctors;
                                         // weak pointer to static atom
 
   nsILinkHandler*       mLinkHandler;   // [WEAK]
   nsIAtom*              mLangGroup;     // [STRONG]
 
-  nsRefPtrHashtable<nsVoidPtrHashKey, nsImageLoader> mImageLoaders;
+  nsRefPtrHashtable<nsVoidPtrHashKey, nsImageLoadNotifier> mImageNotifiers;
 
   nsWeakPtr             mContainer;
 
   float                 mTextZoom;      // Text zoom, defaults to 1.0
   float                 mFullZoom;      // Page zoom, defaults to 1.0
 
   PRInt32               mCurAppUnitsPerDevPixel;
   PRInt32               mAutoQualityMinFontSizePixelsPref;
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -114,17 +114,17 @@
 #include "nsWidgetsCID.h"     // for NS_LOOKANDFEEL_CID
 #include "nsUnicharUtils.h"
 #include "nsLayoutErrors.h"
 #include "nsContentErrors.h"
 #include "nsHTMLContainerFrame.h"
 #include "nsBoxLayoutState.h"
 #include "nsBlockFrame.h"
 #include "nsDisplayList.h"
-#include "nsImageLoader.h"
+#include "nsImageLoadNotifier.h"
 
 #ifdef MOZ_SVG
 #include "nsSVGIntegrationUtils.h"
 #include "nsSVGEffects.h"
 #endif
 
 #include "gfxContext.h"
 
@@ -550,34 +550,34 @@ nsFrame::GetOffsets(PRInt32 &aStart, PRI
   return NS_OK;
 }
 
 // Subclass hook for style post processing
 NS_IMETHODIMP nsFrame::DidSetStyleContext()
 {
   // Ensure that this frame gets invalidates (and, in the case of some
   // 'border-image's, reflows) when images that affect it load.
-  nsRefPtr<nsImageLoader> loaderChain;
+  nsRefPtr<nsImageLoadNotifier> notifierChain;
 
   const nsStyleBackground *background = GetStyleBackground();
   imgIRequest *newBackgroundImage = background->mBackgroundImage;
   if (newBackgroundImage) {
-    loaderChain = nsImageLoader::Create(this, newBackgroundImage,
-                                        PR_FALSE, loaderChain);
+    notifierChain = nsImageLoadNotifier::Create(this, newBackgroundImage,
+                                                PR_FALSE, notifierChain);
   }
 
   const nsStyleBorder *border = GetStyleBorder();
   imgIRequest *newBorderImage = border->GetBorderImage();
   if (newBorderImage) {
-    loaderChain = nsImageLoader::Create(this, newBorderImage,
-                                        border->ImageBorderDiffers(),
-                                        loaderChain);
-  }
-
-  PresContext()->SetImageLoaders(this, loaderChain);
+    notifierChain = nsImageLoadNotifier::Create(this, newBorderImage,
+                                                border->ImageBorderDiffers(),
+                                                notifierChain);
+  }
+
+  PresContext()->SetImageNotifiers(this, notifierChain);
 
   return NS_OK;
 }
 
 /* virtual */ nsMargin
 nsIFrame::GetUsedMargin() const
 {
   NS_ASSERTION(nsLayoutUtils::sDisableGetUsedXAssertions ||