Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn
authorSeth Fowler <mark.seth.fowler@gmail.com>
Thu, 29 Oct 2015 16:37:42 -0700
changeset 270367 f3635689afc1a8b96f94571d4593e01a80c39274
parent 270366 0c3e7157e07f4fd0122b0a0a3636f410ddc6bd73
child 270368 4c95c1ebf91e8c3ba276d76f456063fd8c2cdfbf
push id29612
push userkwierso@gmail.com
push dateFri, 30 Oct 2015 23:36:00 +0000
treeherdermozilla-central@1596ab6985cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1207355
milestone45.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++;