mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1407245 Fix service worker update 24-hour time check conversion from microseconds. r=asuth
This commit is contained in:
parent
cf897d6fcb
commit
fa33ed763d
@ -346,14 +346,14 @@ ServiceWorkerRegistrationInfo::IsLastUpdateCheckTimeOverOneDay() const
|
||||
}
|
||||
|
||||
const int64_t kSecondsPerDay = 86400;
|
||||
const int64_t now =
|
||||
const int64_t nowMicros =
|
||||
mCreationTime + static_cast<PRTime>((TimeStamp::Now() -
|
||||
mCreationTimeStamp).ToMicroseconds());
|
||||
|
||||
// now < mLastUpdateTime if the system time is reset between storing
|
||||
// and loading mLastUpdateTime from ServiceWorkerRegistrar.
|
||||
if (now < mLastUpdateTime ||
|
||||
(now - mLastUpdateTime) / PR_MSEC_PER_SEC > kSecondsPerDay) {
|
||||
if (nowMicros < mLastUpdateTime ||
|
||||
(nowMicros - mLastUpdateTime) / PR_USEC_PER_SEC > kSecondsPerDay) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user