Skip to content

Commit

Permalink
Backed out 5 changesets (bug 1079653) for mochitest-dt asserts on a C…
Browse files Browse the repository at this point in the history
…LOSED TREE.

Backed out changeset aaac8c671299 (bug 1079653)
Backed out changeset 59d1754eb01f (bug 1079653)
Backed out changeset dfb0890b02be (bug 1079653)
Backed out changeset 546f90c14465 (bug 1079653)
Backed out changeset a8e760faf784 (bug 1079653)
  • Loading branch information
rvandermeulen committed Oct 15, 2014
1 parent c4efcdc commit 94b7009
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 135 deletions.
23 changes: 1 addition & 22 deletions image/src/Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ Decoder::Decoder(RasterImage &aImage)
, mCurrentFrame(nullptr)
, mImageData(nullptr)
, mColormap(nullptr)
, mChunkCount(0)
, mDecodeFlags(0)
, mBytesDecoded(0)
, mDecodeDone(false)
, mDataError(false)
, mFrameCount(0)
, mFailCode(NS_OK)
, mNeedsNewFrame(false)
, mNeedsToFlushData(false)
, mInitialized(false)
, mSizeDecode(false)
, mInFrame(false)
Expand Down Expand Up @@ -99,20 +97,10 @@ Decoder::Write(const char* aBuffer, uint32_t aCount, DecodeStrategy aStrategy)
MOZ_ASSERT(!HasDecoderError(),
"Not allowed to make more decoder calls after error!");

// Begin recording telemetry data.
TimeStamp start = TimeStamp::Now();
mChunkCount++;

// Keep track of the total number of bytes written.
mBytesDecoded += aCount;

// If we're flushing data, clear the flag.
if (aBuffer == nullptr && aCount == 0) {
MOZ_ASSERT(mNeedsToFlushData, "Flushing when we don't need to");
mNeedsToFlushData = false;
}

// If a data error occured, just ignore future data.
// If a data error occured, just ignore future data
if (HasDataError())
return;

Expand All @@ -134,9 +122,6 @@ Decoder::Write(const char* aBuffer, uint32_t aCount, DecodeStrategy aStrategy)
WriteInternal(nullptr, 0, aStrategy);
}
}

// Finish telemetry.
mDecodeTime += (TimeStamp::Now() - start);
}

void
Expand Down Expand Up @@ -257,12 +242,6 @@ Decoder::AllocateFrame()
// so they can tell us if they need yet another.
mNeedsNewFrame = false;

// If we've received any data at all, we may have pending data that needs to
// be flushed now that we have a frame to decode into.
if (mBytesDecoded > 0) {
mNeedsToFlushData = true;
}

return rv;
}

Expand Down
21 changes: 0 additions & 21 deletions image/src/Decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ class Decoder
/**
* Writes data to the decoder.
*
* If aBuffer is null and aCount is 0, Write() flushes any buffered data to
* the decoder. Data is buffered if the decoder wasn't able to completely
* decode it because it needed a new frame. If it's necessary to flush data,
* NeedsToFlushData() will return true.
*
* @param aBuffer buffer containing the data to be written
* @param aCount the number of bytes to write
*
Expand Down Expand Up @@ -108,12 +103,6 @@ class Decoder

size_t BytesDecoded() const { return mBytesDecoded; }

// The amount of time we've spent inside Write() so far for this decoder.
TimeDuration DecodeTime() const { return mDecodeTime; }

// The number of times Write() has been called so far for this decoder.
uint32_t ChunkCount() const { return mChunkCount; }

// The number of frames we have, including anything in-progress. Thus, this
// is only 0 if we haven't begun any frames.
uint32_t GetFrameCount() { return mFrameCount; }
Expand Down Expand Up @@ -169,11 +158,6 @@ class Decoder

virtual bool NeedsNewFrame() const { return mNeedsNewFrame; }

// Returns true if we may have stored data that we need to flush now that we
// have a new frame to decode into. Callers can use Write() to actually
// flush the data; see the documentation for that method.
bool NeedsToFlushData() const { return mNeedsToFlushData; }

// Try to allocate a frame as described in mNewFrameData and return the
// status code from that attempt. Clears mNewFrameData.
virtual nsresult AllocateFrame();
Expand Down Expand Up @@ -251,10 +235,6 @@ class Decoder
uint32_t* mColormap; // Current colormap to be used in Cairo format
uint32_t mColormapSize;

// Telemetry data for this decoder.
TimeDuration mDecodeTime;
uint32_t mChunkCount;

uint32_t mDecodeFlags;
size_t mBytesDecoded;
bool mDecodeDone;
Expand Down Expand Up @@ -293,7 +273,6 @@ class Decoder
};
NewFrameData mNewFrameData;
bool mNeedsNewFrame;
bool mNeedsToFlushData;
bool mInitialized;
bool mSizeDecode;
bool mInFrame;
Expand Down
Loading

0 comments on commit 94b7009

Please sign in to comment.