mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1322292 - Some fixes for the Performance API in workers - part 3 - TimeStampToDOMHighRes() in workerPrivate
https://hg.mozilla.org/mozilla-central/rev/b827e4d0dc73
This commit is contained in:
parent
c1d7159d0f
commit
e537f5888d
3 changed files with 9 additions and 9 deletions
|
|
@ -1336,10 +1336,7 @@ Console::MethodInternal(JSContext* aCx, MethodName aMethodName,
|
|||
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(workerPrivate);
|
||||
|
||||
TimeDuration duration =
|
||||
mozilla::TimeStamp::Now() - workerPrivate->CreationTimeStamp();
|
||||
|
||||
monotonicTimer = TimerClamping::ReduceMsTimeValue(duration.ToMilliseconds());
|
||||
monotonicTimer = workerPrivate->TimeStampToDOMHighRes(TimeStamp::Now());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -577,6 +577,13 @@ public:
|
|||
return mCreationTimeHighRes;
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp TimeStampToDOMHighRes(const TimeStamp& aTimeStamp) const
|
||||
{
|
||||
MOZ_ASSERT(!aTimeStamp.IsNull());
|
||||
TimeDuration duration = aTimeStamp - mCreationTimeStamp;
|
||||
return duration.ToMilliseconds();
|
||||
}
|
||||
|
||||
nsIPrincipal*
|
||||
GetPrincipal() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue