Bug 716140 - Remove explicit imgStatusTracker::mBlockingOnload, as it's implied by stateBlockingOnload. r=khuey
authorJoe Drew <joe@drew.ca>
Thu, 20 Dec 2012 11:49:26 -0500
changeset 125619 384efd041a377420a76d480b139bf66030ad92d9
parent 125618 98bab71808e5139de170002a0e9fe8f527d84bd8
child 125620 45d8ebb295435b7e811b2c1ca3e02481199b8773
push id24461
push useremorley@mozilla.com
push dateThu, 21 Mar 2013 11:51:51 +0000
treeherdermozilla-central@a73a2b5c423b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs716140
milestone22.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 716140 - Remove explicit imgStatusTracker::mBlockingOnload, as it's implied by stateBlockingOnload. r=khuey
image/src/imgStatusTracker.cpp
image/src/imgStatusTracker.h
--- a/image/src/imgStatusTracker.cpp
+++ b/image/src/imgStatusTracker.cpp
@@ -43,19 +43,16 @@ public:
     mTracker->RecordStartDecode();
 
     nsTObserverArray<imgRequestProxy*>::ForwardIterator iter(mTracker->mConsumers);
     while (iter.HasMore()) {
       mTracker->SendStartDecode(iter.GetNext());
     }
 
     if (!mTracker->IsMultipart()) {
-      MOZ_ASSERT(!mTracker->mBlockingOnload);
-      mTracker->mBlockingOnload = true;
-
       mTracker->RecordBlockOnload();
 
       nsTObserverArray<imgRequestProxy*>::ForwardIterator iter(mTracker->mConsumers);
       while (iter.HasMore()) {
         mTracker->SendBlockOnload(iter.GetNext());
       }
     }
   }
@@ -193,32 +190,29 @@ private:
   imgStatusTracker* mTracker;
 };
 
 
 // imgStatusTracker methods
 
 imgStatusTracker::imgStatusTracker(Image* aImage)
   : mImage(aImage),
+    mTrackerObserver(new imgStatusTrackerObserver(this)),
     mState(0),
     mImageStatus(imgIRequest::STATUS_NONE),
     mIsMultipart(false),
-    mHadLastPart(false),
-    mBlockingOnload(false)
-{
-  mTrackerObserver = new imgStatusTrackerObserver(this);
-}
+    mHadLastPart(false)
+{}
 
 imgStatusTracker::imgStatusTracker(const imgStatusTracker& aOther)
   : mImage(aOther.mImage),
     mState(aOther.mState),
     mImageStatus(aOther.mImageStatus),
     mIsMultipart(aOther.mIsMultipart),
-    mHadLastPart(aOther.mHadLastPart),
-    mBlockingOnload(aOther.mBlockingOnload)
+    mHadLastPart(aOther.mHadLastPart)
     // Note: we explicitly don't copy mRequestRunnable, because it won't be
     // nulled out when the mRequestRunnable's Run function eventually gets
     // called.
 {}
 
 imgStatusTracker::~imgStatusTracker()
 {}
 
@@ -758,22 +752,20 @@ imgStatusTracker::SendUnblockOnload(imgR
   if (!aProxy->NotificationsDeferred()) {
     aProxy->UnblockOnload();
   }
 }
 
 void
 imgStatusTracker::MaybeUnblockOnload()
 {
-  if (!mBlockingOnload) {
+  if (!(mState & stateBlockingOnload)) {
     return;
   }
 
-  mBlockingOnload = false;
-
   RecordUnblockOnload();
 
   nsTObserverArray<imgRequestProxy*>::ForwardIterator iter(mConsumers);
   while (iter.HasMore()) {
     SendUnblockOnload(iter.GetNext());
   }
 }
 
--- a/image/src/imgStatusTracker.h
+++ b/image/src/imgStatusTracker.h
@@ -195,12 +195,11 @@ private:
   nsTObserverArray<imgRequestProxy*> mConsumers;
 
   mozilla::RefPtr<imgDecoderObserver> mTrackerObserver;
 
   uint32_t mState;
   uint32_t mImageStatus;
   bool mIsMultipart    : 1;
   bool mHadLastPart    : 1;
-  bool mBlockingOnload : 1;
 };
 
 #endif