Bug 1133356 - Expand macro in OnImageAvailable to avoid checking NotificationsDeferred. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 17 Feb 2015 10:15:04 +1300
changeset 229319 2b28ac1903c5380036b7efdc1f9e0c3eb1910ec1
parent 229318 408f0108ff5344c26e98f8ad5c5ab9dd6315c4ea
child 229320 2aee204e65cb7b48f4d69d101b4d5bdefb6cd517
push id55656
push usermwoodrow@mozilla.com
push dateMon, 16 Feb 2015 21:15:55 +0000
treeherdermozilla-inbound@2b28ac1903c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1133356
milestone38.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 1133356 - Expand macro in OnImageAvailable to avoid checking NotificationsDeferred. r=roc
image/src/ProgressTracker.cpp
--- a/image/src/ProgressTracker.cpp
+++ b/image/src/ProgressTracker.cpp
@@ -496,17 +496,24 @@ ProgressTracker::OnImageAvailable()
     // Note: SetHasImage calls Image::Lock and Image::IncrementAnimationCounter
     // so subsequent calls or dispatches which Unlock or Decrement~ should
     // be issued after this to avoid race conditions.
     NS_DispatchToMainThread(
       NS_NewRunnableMethod(this, &ProgressTracker::OnImageAvailable));
     return;
   }
 
-  NOTIFY_IMAGE_OBSERVERS(mObservers, SetHasImage());
+  // Notify any imgRequestProxys that are observing us that we have an Image.
+  ObserverArray::ForwardIterator iter(mObservers);
+  while (iter.HasMore()) {
+    nsRefPtr<IProgressObserver> observer = iter.GetNext().get();
+    if (observer) {
+      observer->SetHasImage();
+    }
+  }
 }
 
 void
 ProgressTracker::FireFailureNotification()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // Some kind of problem has happened with image decoding.