From 85c96a1783271131eb8be969a9c6a0e1bfdb54d7 Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Thu, 29 Oct 2015 16:37:42 -0700 Subject: [PATCH] Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn --- image/imgRequest.cpp | 2 +- image/imgRequestProxy.cpp | 27 +++------------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/image/imgRequest.cpp b/image/imgRequest.cpp index f6862039e38..1d850dc1ad5 100644 --- a/image/imgRequest.cpp +++ b/image/imgRequest.cpp @@ -1053,7 +1053,7 @@ imgRequest::FinishPreparingForNewPart(const NewPartResult& aResult) } if (IsDecodeRequested()) { - aResult.mImage->RequestDecode(); + aResult.mImage->StartDecoding(); } } diff --git a/image/imgRequestProxy.cpp b/image/imgRequestProxy.cpp index bf912ae2fbe..155de9a9544 100644 --- a/image/imgRequestProxy.cpp +++ b/image/imgRequestProxy.cpp @@ -208,15 +208,6 @@ imgRequestProxy::ChangeOwner(imgRequest* aNewOwner) uint32_t oldAnimationConsumers = mAnimationConsumers; ClearAnimationConsumers(); - // Were we decoded before? - bool wasDecoded = false; - RefPtr progressTracker = GetProgressTracker(); - if (progressTracker->HasImage() && - progressTracker->GetImageStatus() & - imgIRequest::STATUS_FRAME_COMPLETE) { - wasDecoded = true; - } - GetOwner()->RemoveProxy(this, NS_IMAGELIB_CHANGING_OWNER); mBehaviour->SetOwner(aNewOwner); @@ -235,9 +226,9 @@ imgRequestProxy::ChangeOwner(imgRequest* aNewOwner) 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(); } @@ -389,18 +380,6 @@ imgRequestProxy::StartDecoding() NS_IMETHODIMP imgRequestProxy::RequestDecode() { - // Flag this, so we know to transfer the request if our owner changes - mDecodeRequested = true; - - RefPtr image = GetImage(); - if (image) { - return image->RequestDecode(); - } - - if (GetOwner()) { - GetOwner()->RequestDecode(); - } - return NS_OK; }