Bug 584841 patch 10: Give imgStatusTracker an Image* instead of imgIContainer*. r=bholley a=blocking
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 13 Aug 2010 21:09:49 -0700
changeset 50554 7695eea587d4c56bc6d67c2a7c61ef5d6ffda11b
parent 50553 205795b2962a27572df753003a849d27c537ee5e
child 50555 f99cedbbc5f62173bda44b20e163af17e94151cf
push id15072
push userdholbert@mozilla.com
push dateSat, 14 Aug 2010 04:11:44 +0000
treeherdermozilla-central@eccba2835f01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, blocking
bugs584841
milestone2.0b4pre
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 584841 patch 10: Give imgStatusTracker an Image* instead of imgIContainer*. r=bholley a=blocking
modules/libpr0n/src/imgStatusTracker.cpp
modules/libpr0n/src/imgStatusTracker.h
--- a/modules/libpr0n/src/imgStatusTracker.cpp
+++ b/modules/libpr0n/src/imgStatusTracker.cpp
@@ -40,27 +40,29 @@
 #include "imgStatusTracker.h"
 
 #include "imgRequest.h"
 #include "imgIContainer.h"
 #include "imgRequestProxy.h"
 #include "Image.h"
 #include "ImageLogging.h"
 
+using namespace mozilla::imagelib;
+
 static nsresult
 GetResultFromImageStatus(PRUint32 aStatus)
 {
   if (aStatus & imgIRequest::STATUS_ERROR)
     return NS_IMAGELIB_ERROR_FAILURE;
   if (aStatus & imgIRequest::STATUS_LOAD_COMPLETE)
     return NS_IMAGELIB_SUCCESS_LOAD_FINISHED;
   return NS_OK;
 }
 
-imgStatusTracker::imgStatusTracker(imgIContainer* aImage)
+imgStatusTracker::imgStatusTracker(Image* aImage)
   : mImage(aImage),
     mState(0),
     mImageStatus(imgIRequest::STATUS_NONE),
     mHadLastPart(PR_FALSE)
 {}
 
 imgStatusTracker::imgStatusTracker(const imgStatusTracker& aOther)
   : mImage(aOther.mImage),
@@ -165,17 +167,17 @@ class imgStatusNotifyRunnable : public n
       mStatus.SyncNotify(mProxy);
       return NS_OK;
     }
 
   private:
     imgStatusTracker mStatus;
     // We have to hold on to a reference to the tracker's image, just in case
     // it goes away while we're in the event queue.
-    nsRefPtr<imgIContainer> mImage;
+    nsRefPtr<Image> mImage;
     nsRefPtr<imgRequestProxy> mProxy;
 };
 
 void
 imgStatusTracker::NotifyCurrentState(imgRequestProxy* proxy)
 {
 #ifdef PR_LOGGING
   nsCOMPtr<nsIURI> uri;
--- a/modules/libpr0n/src/imgStatusTracker.h
+++ b/modules/libpr0n/src/imgStatusTracker.h
@@ -41,16 +41,22 @@
 #define imgStatusTracker_h__
 
 class nsIntRect;
 class imgIContainer;
 class imgRequest;
 class imgRequestProxy;
 class imgStatusNotifyRunnable;
 class imgRequestNotifyRunnable;
+namespace mozilla {
+namespace imagelib {
+class Image;
+} // namespace imagelib
+} // namespace mozilla
+
 
 #include "nsCOMPtr.h"
 #include "nsIRunnable.h"
 #include "prtypes.h"
 #include "nscore.h"
 
 enum {
   stateRequestStarted    = PR_BIT(0),
@@ -73,17 +79,17 @@ enum {
  */
 
 class imgStatusTracker
 {
 public:
   // aImage is the image that this status tracker will pass to the
   // imgRequestProxys in SyncNotify() and EmulateRequestFinished(), and must be
   // alive as long as this instance is, because we hold a weak reference to it.
-  imgStatusTracker(imgIContainer* aImage);
+  imgStatusTracker(mozilla::imagelib::Image* aImage);
   imgStatusTracker(const imgStatusTracker& aOther);
 
   // Schedule an asynchronous "replaying" of all the notifications that would
   // have to happen to put us in the current state.
   // We will also take note of any notifications that happen between the time
   // Notify() is called and when we call SyncNotify on |proxy|, and replay them
   // as well.
   void Notify(imgRequest* request, imgRequestProxy* proxy);
@@ -161,17 +167,17 @@ public:
   void SendStopRequest(imgRequestProxy* aProxy, PRBool aLastPart, nsresult aStatus);
 
 private:
   friend class imgStatusNotifyRunnable;
   friend class imgRequestNotifyRunnable;
 
   nsCOMPtr<nsIRunnable> mRequestRunnable;
 
-  // A weak pointer to the imgIContainer, because the container owns us, and we
+  // A weak pointer to the Image, because it owns us, and we
   // can't create a cycle.
-  imgIContainer* mImage;
+  mozilla::imagelib::Image* mImage;
   PRUint32 mState;
   nsresult mImageStatus;
   PRPackedBool mHadLastPart;
 };
 
 #endif