Bug 1425462 Address performance.timeOrigin which is a constant, so we round only.
MozReview-Commit-ID: AMnSBffwAlG
--- a/dom/performance/Performance.cpp
+++ b/dom/performance/Performance.cpp
@@ -139,17 +139,17 @@ DOMHighResTimeStamp
Performance::TimeOrigin()
{
if (!mPerformanceService) {
mPerformanceService = PerformanceService::GetOrCreate();
}
MOZ_ASSERT(mPerformanceService);
return nsRFPService::ReduceTimePrecisionAsMSecs(
- mPerformanceService->TimeOrigin(CreationTimeStamp()));
+ mPerformanceService->TimeOrigin(CreationTimeStamp()), 0, false);
}
JSObject*
Performance::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
return PerformanceBinding::Wrap(aCx, this, aGivenProto);
}
--- a/toolkit/components/resistfingerprinting/nsRFPService.cpp
+++ b/toolkit/components/resistfingerprinting/nsRFPService.cpp
@@ -150,20 +150,21 @@ nsRFPService::IsTimerPrecisionReductionE
#if defined(DEBUG)
#define INIT_STACKTRACE() \
void* callstack[4]; \
int frames = backtrace(callstack, 4); \
char** thisCaller = backtrace_symbols(callstack, frames);
#define CALLER(caller) \
((strstr(caller[1], "Performance3Now") != NULL) ? "performance.now()" : \
+ ((strstr(caller[1], "Performance10TimeOrigin") != NULL) ? "performance.timeOrigin)" : \
((strstr(caller[1], "dom5Event13TimeStampImplEv") != NULL) ? "Event.timeStamp" : \
((strstr(caller[3], "Animation21DispatchPlaybackEvent") != NULL && strstr(caller[2], "AnimationTimeline22GetCurrentTimeAsDouble") != NULL) ? "AnimationTimeline::GetCurrentTimeAsDouble" : \
((strstr(caller[3], "Animation21DispatchPlaybackEvent") != NULL && strstr(caller[2], "Animation22GetCurrentTimeAsDouble") != NULL) ? "Animation::DispatchPlaybackEvent() -> Animation::GetCurrentTimeAsDouble()" : \
- ""))))
+ "")))))
// I think these circumstances are okay
#define CALLER_CAN_GO_BACKWARDS() \
((strcmp("performance.now()", CALLER(lastCaller)) == 0 && \
strcmp("AnimationTimeline::GetCurrentTimeAsDouble", CALLER(thisCaller)) == 0) ? true : false \
)
#define LOG_TIMESTAMP(aTime, timeOrigin) \