mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-08 00:07:30 +09:00
Bug 1430173 - Reduce the precision of all explicit clocks to 2ms. r=baku, a=RyanVM
Backport to ESR where we don't have the ResistFingerprinting component. MozReview-Commit-ID: 9bjycHjR3SF --HG-- extra : transplant_source : %EA%03%21%0A%E9%3F%8E%CD%7C%D79f%96%85%96%00%5D%7F%95X
This commit is contained in:
parent
128b5dfa13
commit
c66f2e1613
14 changed files with 109 additions and 33 deletions
25
dom/performance/PerformanceTiming.h
Normal file → Executable file
25
dom/performance/PerformanceTiming.h
Normal file → Executable file
|
|
@ -10,6 +10,7 @@
|
|||
#include "mozilla/Attributes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDOMNavigationTiming.h"
|
||||
#include "mozilla/TimerClamping.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "Performance.h"
|
||||
|
||||
|
|
@ -68,10 +69,10 @@ public:
|
|||
* page), if the given TimeStamp is valid. Otherwise, it will return
|
||||
* the FetchStart timing value.
|
||||
*/
|
||||
inline DOMHighResTimeStamp TimeStampToDOMHighResOrFetchStart(TimeStamp aStamp)
|
||||
inline DOMHighResTimeStamp TimeStampToReducedDOMHighResOrFetchStart(TimeStamp aStamp)
|
||||
{
|
||||
return (!aStamp.IsNull())
|
||||
? TimeStampToDOMHighRes(aStamp)
|
||||
? TimerClamping::ReduceMsTimeValue(TimeStampToDOMHighRes(aStamp))
|
||||
: FetchStartHighRes();
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +120,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetNavigationStart();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetNavigationStart());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec UnloadEventStart()
|
||||
|
|
@ -127,7 +128,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetUnloadEventStart();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetUnloadEventStart());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec UnloadEventEnd()
|
||||
|
|
@ -135,7 +136,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetUnloadEventEnd();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetUnloadEventEnd());
|
||||
}
|
||||
|
||||
uint16_t GetRedirectCount() const;
|
||||
|
|
@ -185,7 +186,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetDomLoading();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomLoading());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec DomInteractive() const
|
||||
|
|
@ -193,7 +194,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetDomInteractive();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomInteractive());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec DomContentLoadedEventStart() const
|
||||
|
|
@ -201,7 +202,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetDomContentLoadedEventStart();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomContentLoadedEventStart());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec DomContentLoadedEventEnd() const
|
||||
|
|
@ -209,7 +210,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetDomContentLoadedEventEnd();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomContentLoadedEventEnd());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec DomComplete() const
|
||||
|
|
@ -217,7 +218,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetDomComplete();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetDomComplete());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec LoadEventStart() const
|
||||
|
|
@ -225,7 +226,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetLoadEventStart();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetLoadEventStart());
|
||||
}
|
||||
|
||||
DOMTimeMilliSec LoadEventEnd() const
|
||||
|
|
@ -233,7 +234,7 @@ public:
|
|||
if (!nsContentUtils::IsPerformanceTimingEnabled()) {
|
||||
return 0;
|
||||
}
|
||||
return GetDOMTiming()->GetLoadEventEnd();
|
||||
return TimerClamping::ReduceMsTimeValue(GetDOMTiming()->GetLoadEventEnd());
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue