diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index e2511dd045f9..9dad4574fc7e 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -127,7 +127,8 @@ public: * @param stamp The timestamp to be converted * @returns The converted timestamp */ -uint64_t ComputeAbsoluteTimestamp(PRTime prnow, TimeStamp now, TimeStamp stamp) +static uint64_t +ComputeAbsoluteTimestamp(TimeStamp stamp) { static PRTime sAbsoluteNow = PR_Now(); static TimeStamp sMonotonicNow = TimeStamp::Now(); @@ -756,8 +757,6 @@ nsAppStartup::GetStartupInfo(JSContext* aCx, JS::MutableHandle aRetva aRetval.setObject(*obj); TimeStamp procTime = StartupTimeline::Get(StartupTimeline::PROCESS_CREATION); - TimeStamp now = TimeStamp::Now(); - PRTime absNow = PR_Now(); if (procTime.IsNull()) { bool error = false; @@ -789,7 +788,7 @@ nsAppStartup::GetStartupInfo(JSContext* aCx, JS::MutableHandle aRetva if (!stamp.IsNull()) { if (stamp >= procTime) { - PRTime prStamp = ComputeAbsoluteTimestamp(absNow, now, stamp) + PRTime prStamp = ComputeAbsoluteTimestamp(stamp) / PR_USEC_PER_MSEC; JS::Rooted date(aCx, JS::NewDateObject(aCx, JS::TimeClip(prStamp))); JS_DefineProperty(aCx, obj, StartupTimeline::Describe(ev), date, JSPROP_ENUMERATE); @@ -943,14 +942,12 @@ nsAppStartup::TrackStartupCrashEnd() // Use the timestamp of XRE_main as an approximation for the lock file timestamp. // See MAX_STARTUP_BUFFER for the buffer time period. TimeStamp mainTime = StartupTimeline::Get(StartupTimeline::MAIN); - TimeStamp now = TimeStamp::Now(); - PRTime prNow = PR_Now(); nsresult rv; if (mainTime.IsNull()) { NS_WARNING("Could not get StartupTimeline::MAIN time."); } else { - uint64_t lockFileTime = ComputeAbsoluteTimestamp(prNow, now, mainTime); + uint64_t lockFileTime = ComputeAbsoluteTimestamp(mainTime); rv = Preferences::SetInt(kPrefLastSuccess, (int32_t)(lockFileTime / PR_USEC_PER_SEC));