void ProgressTracker::SyncNotifyProgress(Progress aProgress, const nsIntRect& aInvalidRect /* = nsIntRect() */) { MOZ_ASSERT(NS_IsMainThread(), "Use mObservers on main thread only"); // Don't unblock onload if we're not blocked. Progress progress = Difference(aProgress); if (!((mProgress | progress) & FLAG_ONLOAD_BLOCKED)) { progress &= ~FLAG_ONLOAD_UNBLOCKED; } // XXX(seth): Hack to work around the fact that some observers have bugs and // need to get onload blocking notifications multiple times. We should fix // those observers and remove this. if ((aProgress & FLAG_DECODE_COMPLETE) && (mProgress & FLAG_ONLOAD_BLOCKED) && (mProgress & FLAG_ONLOAD_UNBLOCKED)) { progress |= FLAG_ONLOAD_BLOCKED | FLAG_ONLOAD_UNBLOCKED; } // Apply the changes. mProgress |= progress; CheckProgressConsistency(mProgress); // Send notifications. SyncNotifyInternal(mObservers, HasImage(), progress, aInvalidRect); if (progress & FLAG_HAS_ERROR) { FireFailureNotification(); } }
void ProgressTracker::SyncNotifyProgress(Progress aProgress, const nsIntRect& aInvalidRect /* = nsIntRect() */) { MOZ_ASSERT(NS_IsMainThread(), "Use mConsumers on main thread only"); // Don't unblock onload if we're not blocked. Progress progress = Difference(aProgress); if (!((mProgress | progress) & FLAG_ONLOAD_BLOCKED)) { progress &= ~FLAG_ONLOAD_UNBLOCKED; } // Apply the changes. mProgress |= progress; CheckProgressConsistency(mProgress); // Send notifications. SyncNotifyInternal(mConsumers, !!mImage, progress, aInvalidRect); if (progress & FLAG_HAS_ERROR) { FireFailureNotification(); } }