34 lines
1.3 KiB
Text
34 lines
1.3 KiB
Text
commit 3c4493ef2e44
|
|
Author: Ben Kelly <ben@wanderview.com>
|
|
Date: Tue Oct 10 13:50:36 2017 -0700
|
|
|
|
Bug 1407245 - Fix service worker update 24-hour time check conversion from microseconds. r=asuth, a=ritu
|
|
|
|
--HG--
|
|
extra : source : 412da89cc8e754831e6942b55d3cfd0ea3f1c88b
|
|
---
|
|
dom/workers/ServiceWorkerRegistrationInfo.cpp | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git dom/workers/ServiceWorkerRegistrationInfo.cpp dom/workers/ServiceWorkerRegistrationInfo.cpp
|
|
index 07b9726677cc..beca30d82387 100644
|
|
--- dom/workers/ServiceWorkerRegistrationInfo.cpp
|
|
+++ dom/workers/ServiceWorkerRegistrationInfo.cpp
|
|
@@ -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;
|