From 089a0bd9a4dace03e5800878055b86854eee5002 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:32:19 +0200 Subject: Bug 1322292 - Some fixes for the Performance API in workers - part 2 - Get rid of NowBaseTimeStamp() https://hg.mozilla.org/mozilla-central/rev/301231f4165a --- dom/events/Event.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'dom/events/Event.cpp') diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 7e19cd74d..4e39675da 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -1146,15 +1146,14 @@ Event::TimeStampImpl() const return perf->GetDOMTiming()->TimeStampToDOMHighRes(mEvent->mTimeStamp); } - // For dedicated workers, we should make times relative to the navigation - // start of the document that created the worker, which is the same as the - // timebase for performance.now(). + // For dedicated workers, we should make times relative to the creation time + // of the worker, which is the same as the timebase for performance.now(). workers::WorkerPrivate* workerPrivate = workers::GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); TimeDuration duration = - mEvent->mTimeStamp - workerPrivate->NowBaseTimeStamp(); + mEvent->mTimeStamp - workerPrivate->CreationTimeStamp(); return duration.ToMilliseconds(); } -- cgit v1.2.3 From eeaf0a73acf661662b9baf9929c9688c60d0bf38 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:35:55 +0200 Subject: Bug 1322292 - Some fixes for the Performance API in workers - part 3 - TimeStampToDOMHighRes() in workerPrivate https://hg.mozilla.org/mozilla-central/rev/b827e4d0dc73 --- dom/events/Event.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'dom/events/Event.cpp') diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 4e39675da..4b9776c0a 100755 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -1146,15 +1146,11 @@ Event::TimeStampImpl() const return perf->GetDOMTiming()->TimeStampToDOMHighRes(mEvent->mTimeStamp); } - // For dedicated workers, we should make times relative to the creation time - // of the worker, which is the same as the timebase for performance.now(). workers::WorkerPrivate* workerPrivate = workers::GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); - TimeDuration duration = - mEvent->mTimeStamp - workerPrivate->CreationTimeStamp(); - return duration.ToMilliseconds(); + return workerPrivate->TimeStampToDOMHighRes(mEvent->mTimeStamp); } bool -- cgit v1.2.3