mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1427870 - Change resolution of .now() to 20us. r=bkelly, a=lizzard
The comment about workers was introduced in Bug 1186489 but became obsolete some time after that (definitely by Bug 1278838)
This commit is contained in:
parent
b6e7d3a2ba
commit
29a0059ef9
@ -243,10 +243,9 @@ Performance::ClearResourceTimings()
|
||||
DOMHighResTimeStamp
|
||||
Performance::RoundTime(double aTime) const
|
||||
{
|
||||
// Round down to the nearest 5us, because if the timer is too accurate people
|
||||
// can do nasty timing attacks with it. See similar code in the worker
|
||||
// Performance implementation.
|
||||
const double maxResolutionMs = 0.005;
|
||||
// Round down to the nearest 20us, because if the timer is too accurate people
|
||||
// can do nasty timing attacks with it.
|
||||
const double maxResolutionMs = 0.020;
|
||||
return nsRFPService::ReduceTimePrecisionAsMSecs(
|
||||
floor(aTime / maxResolutionMs) * maxResolutionMs);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user