Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn

This commit is contained in:
Seth Fowler 2015-10-29 16:37:42 -07:00
parent 2890d430b7
commit 85c96a1783
2 changed files with 4 additions and 25 deletions

View File

@ -1053,7 +1053,7 @@ imgRequest::FinishPreparingForNewPart(const NewPartResult& aResult)
}
if (IsDecodeRequested()) {
aResult.mImage->RequestDecode();
aResult.mImage->StartDecoding();
}
}

View File

@ -208,15 +208,6 @@ imgRequestProxy::ChangeOwner(imgRequest* aNewOwner)
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);
@ -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> image = GetImage();
if (image) {
return image->RequestDecode();
}
if (GetOwner()) {
GetOwner()->RequestDecode();
}
return NS_OK;
}