Bug 1133356 - Expand macro in OnImageAvailable to avoid checking NotificationsDeferred. r=roc, a=sylvestre
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 17 Feb 2015 10:15:04 +1300
changeset 249750 997fae1e1f883fe50fa0df510678c1a07b148580
parent 249749 08c80799023058c6b9a0b2af14583c07a5693ec2
child 249751 1220d2300693e85b9db663d35d4742326a2c6ab7
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, sylvestre
bugs1133356
milestone37.0a2
Bug 1133356 - Expand macro in OnImageAvailable to avoid checking NotificationsDeferred. r=roc, a=sylvestre
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.