From 7ee501103ad2efe1d28ef3c10b4111a685746c06 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:07:20 +0200 Subject: Bug 1322966 - Cleanup performance.cpp https://hg.mozilla.org/mozilla-central/rev/0ad76084c4c3 --- dom/performance/Performance.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'dom/performance/Performance.cpp') diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 497bdea27..074bffe8a 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -82,14 +82,12 @@ NS_IMPL_RELEASE_INHERITED(Performance, DOMEventTargetHelper) /* static */ already_AddRefed Performance::CreateForMainThread(nsPIDOMWindowInner* aWindow, nsDOMNavigationTiming* aDOMTiming, - nsITimedChannel* aChannel, - Performance* aParentPerformance) + nsITimedChannel* aChannel) { MOZ_ASSERT(NS_IsMainThread()); RefPtr performance = - new PerformanceMainThread(aWindow, aDOMTiming, aChannel, - aParentPerformance); + new PerformanceMainThread(aWindow, aDOMTiming, aChannel); return performance.forget(); } -- cgit v1.2.3 From 98438fa32e4f93b59359662188e164c7c828acb7 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:15:36 +0200 Subject: Bug 1313420 - Implement Performance.timeOrigin - part 1 https://hg.mozilla.org/mozilla-central/rev/cf0f72f0b0be --- dom/performance/Performance.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dom/performance/Performance.cpp') diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 074bffe8a..d1547dc06 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -13,6 +13,7 @@ #include "PerformanceMeasure.h" #include "PerformanceObserver.h" #include "PerformanceResourceTiming.h" +#include "PerformanceService.h" #include "PerformanceWorker.h" #include "mozilla/ErrorResult.h" #include "mozilla/dom/PerformanceBinding.h" @@ -119,6 +120,17 @@ Performance::Performance(nsPIDOMWindowInner* aWindow) Performance::~Performance() {} +DOMHighResTimeStamp +Performance::TimeOrigin() +{ + if (!mPerformanceService) { + mPerformanceService = PerformanceService::GetOrCreate(); + } + + MOZ_ASSERT(mPerformanceService); + return mPerformanceService->TimeOrigin(CreationTimeStamp()); +} + JSObject* Performance::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { @@ -243,7 +255,7 @@ Performance::ClearMarks(const Optional& aName) DOMHighResTimeStamp Performance::ResolveTimestampFromName(const nsAString& aName, - ErrorResult& aRv) + ErrorResult& aRv) { AutoTArray, 1> arr; DOMHighResTimeStamp ts; -- cgit v1.2.3 From 85a83305dd0caeb484687cf511f81024a683338b Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:26:49 +0200 Subject: Bug 1322292 - Some fixes for the Performance API in workers - part 1 - Centralized Performance.now() https://hg.mozilla.org/mozilla-central/rev/291a68ca4825 --- dom/performance/Performance.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dom/performance/Performance.cpp') diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index d1547dc06..8f6a61c85 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -120,6 +120,13 @@ Performance::Performance(nsPIDOMWindowInner* aWindow) Performance::~Performance() {} +DOMHighResTimeStamp +Performance::Now() const +{ + TimeDuration duration = TimeStamp::Now() - CreationTimeStamp(); + return RoundTime(duration.ToMilliseconds()); +} + DOMHighResTimeStamp Performance::TimeOrigin() { -- cgit v1.2.3 From 306db80410e802b0fe9a3b5273d4cf29586a1b17 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 14:15:18 +0200 Subject: moebius#161: The Performance Resource Timing (make timestamps be relative to startTime) https://github.com/MoonchildProductions/moebius/pull/161 --- dom/performance/Performance.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'dom/performance/Performance.cpp') diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 8f6a61c85..93a6b7313 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -20,6 +20,7 @@ #include "mozilla/dom/PerformanceEntryEvent.h" #include "mozilla/dom/PerformanceNavigationBinding.h" #include "mozilla/dom/PerformanceObserverBinding.h" +#include "mozilla/dom/PerformanceNavigationTiming.h" #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/Preferences.h" #include "mozilla/TimerClamping.h" -- cgit v1.2.3