зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1285867 (Part 5) - Replace Decoder::mDataDone with Decoder::mReachedTerminalState. r=edwin
This commit is contained in:
Родитель
396c016b13
Коммит
063f83b278
|
@ -65,7 +65,7 @@ Decoder::Decoder(RasterImage* aImage)
|
|||
, mInitialized(false)
|
||||
, mMetadataDecode(false)
|
||||
, mInFrame(false)
|
||||
, mDataDone(false)
|
||||
, mReachedTerminalState(false)
|
||||
, mDecodeDone(false)
|
||||
, mDataError(false)
|
||||
, mDecodeAborted(false)
|
||||
|
@ -143,8 +143,6 @@ Decoder::Decode(NotNull<IResumable*> aOnResume)
|
|||
return NS_OK;
|
||||
|
||||
case SourceBufferIterator::COMPLETE:
|
||||
mDataDone = true;
|
||||
|
||||
// Normally even if the data is truncated, we want decoding to
|
||||
// succeed so we can display whatever we got. However, if the
|
||||
// SourceBuffer was completed with a failing status, we want to fail.
|
||||
|
@ -175,6 +173,7 @@ Decoder::Decode(NotNull<IResumable*> aOnResume)
|
|||
} while (!terminalState);
|
||||
|
||||
MOZ_ASSERT(terminalState);
|
||||
mReachedTerminalState = true;
|
||||
|
||||
// If decoding failed, record that fact.
|
||||
if (terminalState == Some(TerminalState::FAILURE)) {
|
||||
|
|
|
@ -193,8 +193,8 @@ public:
|
|||
/// Did we finish decoding enough that calling Decode() again would be useless?
|
||||
bool GetDecodeDone() const
|
||||
{
|
||||
return mDecodeDone || (mMetadataDecode && HasSize()) ||
|
||||
HasError() || mDataDone;
|
||||
return mReachedTerminalState || mDecodeDone ||
|
||||
(mMetadataDecode && HasSize()) || HasError();
|
||||
}
|
||||
|
||||
/// Are we in the middle of a frame right now? Used for assertions only.
|
||||
|
@ -425,7 +425,7 @@ private:
|
|||
bool mInitialized : 1;
|
||||
bool mMetadataDecode : 1;
|
||||
bool mInFrame : 1;
|
||||
bool mDataDone : 1;
|
||||
bool mReachedTerminalState : 1;
|
||||
bool mDecodeDone : 1;
|
||||
bool mDataError : 1;
|
||||
bool mDecodeAborted : 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче