mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1226443 P5 Always use first scheduled update timer instead of rescheduling on new events. r=ehsan
This commit is contained in:
parent
a878b0eee8
commit
4c714c7843
@ -4854,14 +4854,17 @@ ServiceWorkerManager::ScheduleUpdateTimer(nsIPrincipal* aPrincipal,
|
||||
|
||||
nsCOMPtr<nsITimer> timer = data->mUpdateTimers.Get(aScope);
|
||||
if (timer) {
|
||||
timer->Cancel();
|
||||
data->mUpdateTimers.Remove(aScope);
|
||||
} else {
|
||||
// There is already a timer scheduled. In this case just use the original
|
||||
// schedule time. We don't want to push it out to a later time since that
|
||||
// could allow updates to be starved forever if events are continuously
|
||||
// fired.
|
||||
return;
|
||||
}
|
||||
|
||||
timer = do_CreateInstance("@mozilla.org/timer;1", &rv);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nsCOMPtr<nsITimerCallback> callback = new UpdateTimerCallback(aPrincipal,
|
||||
aScope);
|
||||
|
Loading…
Reference in New Issue
Block a user