diff options
Diffstat (limited to 'dom/performance/Performance.h')
-rw-r--r-- | dom/performance/Performance.h | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/dom/performance/Performance.h b/dom/performance/Performance.h index bc70589a5..4debecc90 100644 --- a/dom/performance/Performance.h +++ b/dom/performance/Performance.h @@ -24,6 +24,7 @@ namespace dom { class PerformanceEntry; class PerformanceNavigation; class PerformanceObserver; +class PerformanceService; class PerformanceTiming; namespace workers { @@ -45,8 +46,7 @@ public: static already_AddRefed<Performance> CreateForMainThread(nsPIDOMWindowInner* aWindow, nsDOMNavigationTiming* aDOMTiming, - nsITimedChannel* aChannel, - Performance* aParentPerformance); + nsITimedChannel* aChannel); static already_AddRefed<Performance> CreateForWorker(workers::WorkerPrivate* aWorkerPrivate); @@ -54,21 +54,23 @@ public: JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override; - void GetEntries(nsTArray<RefPtr<PerformanceEntry>>& aRetval); + virtual void GetEntries(nsTArray<RefPtr<PerformanceEntry>>& aRetval); - void GetEntriesByType(const nsAString& aEntryType, - nsTArray<RefPtr<PerformanceEntry>>& aRetval); + virtual void GetEntriesByType(const nsAString& aEntryType, + nsTArray<RefPtr<PerformanceEntry>>& aRetval); - void GetEntriesByName(const nsAString& aName, - const Optional<nsAString>& aEntryType, - nsTArray<RefPtr<PerformanceEntry>>& aRetval); + virtual void GetEntriesByName(const nsAString& aName, + const Optional<nsAString>& aEntryType, + nsTArray<RefPtr<PerformanceEntry>>& aRetval); virtual void AddEntry(nsIHttpChannel* channel, nsITimedChannel* timedChannel) = 0; void ClearResourceTimings(); - virtual DOMHighResTimeStamp Now() const = 0; + DOMHighResTimeStamp Now() const; + + DOMHighResTimeStamp TimeOrigin(); void Mark(const nsAString& aName, ErrorResult& aRv); @@ -101,8 +103,6 @@ public: virtual nsITimedChannel* GetChannel() const = 0; - virtual Performance* GetParentPerformance() const = 0; - protected: Performance(); explicit Performance(nsPIDOMWindowInner* aWindow); @@ -126,10 +126,16 @@ protected: virtual DOMHighResTimeStamp CreationTime() const = 0; - virtual bool IsPerformanceTimingAttribute(const nsAString& aName) = 0; + virtual bool IsPerformanceTimingAttribute(const nsAString& aName) + { + return false; + } virtual DOMHighResTimeStamp - GetPerformanceTimingFromString(const nsAString& aTimingName) = 0; + GetPerformanceTimingFromString(const nsAString& aTimingName) + { + return 0; + } bool IsResourceEntryLimitReached() const { @@ -147,13 +153,15 @@ protected: nsTObserverArray<PerformanceObserver*> mObservers; -private: +protected: nsTArray<RefPtr<PerformanceEntry>> mUserEntries; nsTArray<RefPtr<PerformanceEntry>> mResourceEntries; uint64_t mResourceTimingBufferSize; static const uint64_t kDefaultResourceTimingBufferSize = 150; bool mPendingNotificationObserversTask; + + RefPtr<PerformanceService> mPerformanceService; }; } // namespace dom |