summaryrefslogtreecommitdiffstats
path: root/dom/performance/PerformanceObserverEntryList.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-04-29 14:44:02 +0200
committerGitHub <noreply@github.com>2018-04-29 14:44:02 +0200
commitdc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b (patch)
tree56d8df17bdaa6a4558c7b0ed887c9302766f347a /dom/performance/PerformanceObserverEntryList.cpp
parent65a580a4efedf51cc542fff8c12b487a2113b987 (diff)
parentbdb4ff581677ad1cd411b55a68c87534f9a64882 (diff)
downloadUXP-dc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b.tar
UXP-dc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b.tar.gz
UXP-dc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b.tar.lz
UXP-dc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b.tar.xz
UXP-dc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b.zip
Merge pull request #292 from janekptacijarabaci/js_dom_performance-observer_1
moebius#157: The Performance Observer (improvements)
Diffstat (limited to 'dom/performance/PerformanceObserverEntryList.cpp')
-rw-r--r--dom/performance/PerformanceObserverEntryList.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/dom/performance/PerformanceObserverEntryList.cpp b/dom/performance/PerformanceObserverEntryList.cpp
index 349103f08..20e818f3d 100644
--- a/dom/performance/PerformanceObserverEntryList.cpp
+++ b/dom/performance/PerformanceObserverEntryList.cpp
@@ -66,6 +66,7 @@ PerformanceObserverEntryList::GetEntries(
aRetval.AppendElement(entry);
}
+ aRetval.Sort(PerformanceEntryComparator());
}
void
@@ -79,6 +80,7 @@ PerformanceObserverEntryList::GetEntriesByType(
aRetval.AppendElement(entry);
}
}
+ aRetval.Sort(PerformanceEntryComparator());
}
void
@@ -88,9 +90,18 @@ PerformanceObserverEntryList::GetEntriesByName(
nsTArray<RefPtr<PerformanceEntry>>& aRetval)
{
aRetval.Clear();
+ const bool typePassed = aEntryType.WasPassed();
for (const RefPtr<PerformanceEntry>& entry : mEntries) {
- if (entry->GetName().Equals(aName)) {
- aRetval.AppendElement(entry);
+ if (!entry->GetName().Equals(aName)) {
+ continue;
}
+
+ if (typePassed &&
+ !entry->GetEntryType().Equals(aEntryType.Value())) {
+ continue;
+ }
+
+ aRetval.AppendElement(entry);
}
+ aRetval.Sort(PerformanceEntryComparator());
}