Bug 1285865 (Part 1) - Remove Decoder::Write() checks that are redundant with Decoder::Decode(). r=edwin
authorSeth Fowler <mark.seth.fowler@gmail.com>
Mon, 11 Jul 2016 00:02:42 -0700
changeset 344581 3900aecb41536651d264229ea73ed9d6f3661089
parent 344580 9157099559f4fe0465ab234df9a035415b413991
child 344582 d98e5a17a183627262c48d8651f6997ec705ffcd
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1285865
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1285865 (Part 1) - Remove Decoder::Write() checks that are redundant with Decoder::Decode(). r=edwin
image/Decoder.cpp
--- a/image/Decoder.cpp
+++ b/image/Decoder.cpp
@@ -137,37 +137,23 @@ void
 Decoder::Write(const char* aBuffer, uint32_t aCount)
 {
   PROFILER_LABEL("ImageDecoder", "Write",
     js::ProfileEntry::Category::GRAPHICS);
 
   MOZ_ASSERT(aBuffer);
   MOZ_ASSERT(aCount > 0);
 
-  // We're strict about decoder errors
-  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 a data error occured, just ignore future data.
-  if (HasDataError()) {
-    return;
-  }
-
-  if (IsMetadataDecode() && HasSize()) {
-    // More data came in since we found the size. We have nothing to do here.
-    return;
-  }
-
   // Pass the data along to the implementation.
   WriteInternal(aBuffer, aCount);
 
   // Finish telemetry.
   mDecodeTime += (TimeStamp::Now() - start);
 }
 
 void