Issue #2282 - - Properly implement Performance Timeline Level 2 w3c spec. https://bugzilla.mozilla.org/show_bug.cgi?id=1539006 Do not throw from PerformanceObserver.observe when none of the entryTypes are known. https://bugzilla.mozilla.org/show_bug.cgi?id=1403027 Implement PerformanceObserver::takeRecords(). https://bugzilla.mozilla.org/show_bug.cgi?id=1436692 "server" is not a valid PerformanceEntry type. https://bugzilla.mozilla.org/show_bug.cgi?id=1463065 Fix a null ptr crash in PerformanceObserver::Observe. https://bugzilla.mozilla.org/show_bug.cgi?id=1631346

This commit is contained in:
Brian Smith 2023-08-02 02:41:40 -05:00 committed by roytam1
commit dd4c0a44b6
8 changed files with 284 additions and 49 deletions

View file

@ -711,9 +711,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();