From bdb4ff581677ad1cd411b55a68c87534f9a64882 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 22 Apr 2018 04:25:34 +0200 Subject: moebius#157: The Performance Observer (improvements) https://github.com/MoonchildProductions/moebius/pull/157 --- dom/performance/PerformanceEntry.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'dom/performance/PerformanceEntry.h') diff --git a/dom/performance/PerformanceEntry.h b/dom/performance/PerformanceEntry.h index bc4f84f1c..0af9f669e 100644 --- a/dom/performance/PerformanceEntry.h +++ b/dom/performance/PerformanceEntry.h @@ -90,6 +90,27 @@ protected: nsString mEntryType; }; +// Helper classes +class MOZ_STACK_CLASS PerformanceEntryComparator final +{ +public: + bool Equals(const PerformanceEntry* aElem1, + const PerformanceEntry* aElem2) const + { + MOZ_ASSERT(aElem1 && aElem2, + "Trying to compare null performance entries"); + return aElem1->StartTime() == aElem2->StartTime(); + } + + bool LessThan(const PerformanceEntry* aElem1, + const PerformanceEntry* aElem2) const + { + MOZ_ASSERT(aElem1 && aElem2, + "Trying to compare null performance entries"); + return aElem1->StartTime() < aElem2->StartTime(); + } +}; + } // namespace dom } // namespace mozilla -- cgit v1.2.3