Bug 1194059 (Part 1) - Ensure that metadata decode progress is always delivered atomically. r=tn
authorSeth Fowler <mark.seth.fowler@gmail.com>
Fri, 14 Aug 2015 00:37:11 -0700
changeset 257776 ddd36b0369e685d65bb380dfac623151a02d5654
parent 257775 54d0fc9946067a995cc49326fd3861303cd1f105
child 257777 167ceb9650797d3281a4940450604893dc6bad26
push id29226
push userryanvm@gmail.com
push dateFri, 14 Aug 2015 13:01:14 +0000
treeherdermozilla-central@1b2402247429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs1194059
milestone43.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 1194059 (Part 1) - Ensure that metadata decode progress is always delivered atomically. r=tn
image/DecodePool.cpp
--- a/image/DecodePool.cpp
+++ b/image/DecodePool.cpp
@@ -446,17 +446,20 @@ DecodePool::GetIOEventTarget()
 void
 DecodePool::Decode(Decoder* aDecoder)
 {
   MOZ_ASSERT(aDecoder);
 
   nsresult rv = aDecoder->Decode();
 
   if (NS_SUCCEEDED(rv) && !aDecoder->GetDecodeDone()) {
-    if (aDecoder->HasProgress()) {
+    // If this isn't a metadata decode, notify for the progress we've made so
+    // far. It's important that metadata decode results are delivered
+    // atomically, so for those decodes we wait until NotifyDecodeComplete.
+    if (aDecoder->HasProgress() && !aDecoder->IsMetadataDecode()) {
       NotifyProgress(aDecoder);
     }
     // The decoder will ensure that a new worker gets enqueued to continue
     // decoding when more data is available.
   } else {
     NotifyDecodeComplete(aDecoder);
   }
 }