From 33df9f9433657750c7a294530f8861b5b2cd714d Mon Sep 17 00:00:00 2001 From: Seth Fowler Date: Wed, 15 Oct 2014 13:52:21 -0700 Subject: [PATCH] Bug 1079653 (Part 2) - Remove DecodeRequest::mBytesToDecode. r=tn --HG-- extra : rebase_source : 44b8aa4989b504e10854534cb26a2a2567676fa9 --- image/src/RasterImage.cpp | 12 +++++------- image/src/RasterImage.h | 3 --- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index 46a708564e6..12e93fb4223 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -3206,11 +3206,6 @@ RasterImage::DecodePool::RequestDecode(RasterImage* aImg) // If we're currently waiting on a new frame for this image, we can't do any // decoding. if (!aImg->mDecoder->NeedsNewFrame()) { - // No matter whether this is currently being decoded, we need to update the - // number of bytes we want it to decode. - aImg->mDecodeRequest->mBytesToDecode = - aImg->mSourceData.Length() - aImg->mDecoder->BytesDecoded(); - if (aImg->mDecodeRequest->mRequestStatus == DecodeRequest::REQUEST_PENDING || aImg->mDecodeRequest->mRequestStatus == DecodeRequest::REQUEST_ACTIVE) { // The image is already in our list of images to decode, or currently being @@ -3311,7 +3306,10 @@ RasterImage::DecodePool::DecodeJob::Run() type = DECODE_TYPE_UNTIL_TIME; } - DecodePool::Singleton()->DecodeSomeOfImage(mImage, DECODE_ASYNC, type, mRequest->mBytesToDecode); + size_t maxBytes = mImage->mSourceData.Length() - + mImage->mDecoder->BytesDecoded(); + DecodePool::Singleton()->DecodeSomeOfImage(mImage, DECODE_ASYNC, + type, maxBytes); size_t bytesDecoded = mImage->mDecoder->BytesDecoded() - oldByteCount; @@ -3328,7 +3326,7 @@ RasterImage::DecodePool::DecodeJob::Run() !mImage->mError && !mImage->mPendingError && !mImage->IsDecodeFinished() && - bytesDecoded < mRequest->mBytesToDecode && + bytesDecoded < maxBytes && bytesDecoded > 0) { DecodePool::Singleton()->RequestDecode(mImage); } else { diff --git a/image/src/RasterImage.h b/image/src/RasterImage.h index eb3677efeb4..5497712076d 100644 --- a/image/src/RasterImage.h +++ b/image/src/RasterImage.h @@ -329,7 +329,6 @@ private: { explicit DecodeRequest(RasterImage* aImage) : mImage(aImage) - , mBytesToDecode(0) , mRequestStatus(REQUEST_INACTIVE) , mAllocatedNewFrame(false) { @@ -347,8 +346,6 @@ private: RasterImage* mImage; - size_t mBytesToDecode; - enum DecodeRequestStatus { REQUEST_INACTIVE,