Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn
☠☠ backed out by b4c323832f31 ☠ ☠
authorSeth Fowler <mark.seth.fowler@gmail.com>
Wed, 28 Oct 2015 16:40:43 -0700
changeset 270125 e941e0e106a1f501424cb08f304455cb1cf9d8b2
parent 270124 ecebca101fcbe546e187abed4f0469c0fd96d920
child 270126 9dd950b837fb0759ac94e33506b0ca375b19d893
push id29599
push usercbook@mozilla.com
push dateThu, 29 Oct 2015 10:49:48 +0000
treeherdermozilla-central@67a788db9f07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1207355
milestone44.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 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn
image/imgRequest.cpp
image/imgRequestProxy.cpp
--- a/image/imgRequest.cpp
+++ b/image/imgRequest.cpp
@@ -1048,17 +1048,17 @@ imgRequest::FinishPreparingForNewPart(co
     MOZ_ASSERT(progressTracker->HasImage());
   }
 
   if (aResult.mShouldResetCacheEntry) {
     ResetCacheEntry();
   }
 
   if (IsDecodeRequested()) {
-    aResult.mImage->RequestDecode();
+    aResult.mImage->StartDecoding();
   }
 }
 
 NS_IMETHODIMP
 imgRequest::OnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
                             nsIInputStream* aInStr, uint64_t aOffset,
                             uint32_t aCount)
 {
--- a/image/imgRequestProxy.cpp
+++ b/image/imgRequestProxy.cpp
@@ -203,25 +203,16 @@ imgRequestProxy::ChangeOwner(imgRequest*
   while (mLockCount) {
     UnlockImage();
   }
 
   // If we're holding animation requests, undo them.
   uint32_t oldAnimationConsumers = mAnimationConsumers;
   ClearAnimationConsumers();
 
-  // Were we decoded before?
-  bool wasDecoded = false;
-  RefPtr<ProgressTracker> progressTracker = GetProgressTracker();
-  if (progressTracker->HasImage() &&
-      progressTracker->GetImageStatus() &
-        imgIRequest::STATUS_FRAME_COMPLETE) {
-    wasDecoded = true;
-  }
-
   GetOwner()->RemoveProxy(this, NS_IMAGELIB_CHANGING_OWNER);
 
   mBehaviour->SetOwner(aNewOwner);
 
   // If we were locked, apply the locks here
   for (uint32_t i = 0; i < oldLockCount; i++) {
     LockImage();
   }
@@ -230,19 +221,19 @@ imgRequestProxy::ChangeOwner(imgRequest*
   // do this *after* RemoveProxy, which clears out animation consumers
   // (see bug 601723).
   for (uint32_t i = 0; i < oldAnimationConsumers; i++) {
     IncrementAnimationConsumers();
   }
 
   GetOwner()->AddProxy(this);
 
-  // If we were decoded, or if we'd previously requested a decode, request a
-  // decode on the new image
-  if (wasDecoded || mDecodeRequested) {
+  // If we'd previously requested a synchronous decode, request a decode on the
+  // new image.
+  if (mDecodeRequested) {
     StartDecoding();
   }
 
   return NS_OK;
 }
 
 void
 imgRequestProxy::AddToLoadGroup()
@@ -384,28 +375,16 @@ imgRequestProxy::StartDecoding()
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 imgRequestProxy::RequestDecode()
 {
-  // Flag this, so we know to transfer the request if our owner changes
-  mDecodeRequested = true;
-
-  RefPtr<Image> image = GetImage();
-  if (image) {
-    return image->RequestDecode();
-  }
-
-  if (GetOwner()) {
-    GetOwner()->RequestDecode();
-  }
-
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 imgRequestProxy::LockImage()
 {
   mLockCount++;