summaryrefslogtreecommitdiff
path: root/dom/performance/Performance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/performance/Performance.cpp')
-rwxr-xr-xdom/performance/Performance.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp
index 217faa5afe..e8a46409ef 100755
--- a/dom/performance/Performance.cpp
+++ b/dom/performance/Performance.cpp
@@ -712,9 +712,21 @@ Performance::QueueEntry(PerformanceEntry* aEntry)
if (mObservers.IsEmpty()) {
return;
}
- NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers,
- PerformanceObserver,
- QueueEntry, (aEntry));
+ nsTObserverArray<PerformanceObserver*> interestedObservers;
+ nsTObserverArray<PerformanceObserver*>::ForwardIterator observerIt(
+ mObservers);
+ while (observerIt.HasMore()) {
+ PerformanceObserver* observer = observerIt.GetNext();
+ if (observer->ObservesTypeOfEntry(aEntry)) {
+ interestedObservers.AppendElement(observer);
+ }
+ }
+
+ if (interestedObservers.IsEmpty()) {
+ return;
+ }
+
+ NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(interestedObservers, PerformanceObserver, QueueEntry, (aEntry));
if (!mPendingNotificationObserversTask) {
RunNotificationObserversTask();