DescriptionService Worker: Update stale workers
Before this patch we only update a worker on main resource navigation
inside its scope. This means a Push-only SW for which you don't navigate
to its scope is never updated.
This patch introduces a way to update "stale" workers. A worker that
hasn't been checked for update from the network for over 24 hours is
considered stale. We check for staleness when a worker starts up and
periodically while it's running. We try to update stale workers once
they stop (one reason is that skipWaiting() may kick out the worker
before it finished handling the event that triggered the staleness
check; also want to avoid network contention while the incumbent is
handling an event). However if a worker is running too long, an update
may be triggered (otherwise, a constant stream of events keeping the
worker alive would prevent it from ever updating).
BUG=477598
TEST=ServiceWorkerVersionTest.StaleUpdate*
Committed: https://crrev.com/13053b7698140f33fc71dd7ab92b01ef3ec45551
Cr-Commit-Position: refs/heads/master@{#335901}
Patch Set 1 #Patch Set 2 : safer reg holding #
Total comments: 9
Patch Set 3 : rebase #Patch Set 4 : review comments #
Total comments: 4
Patch Set 5 : fix asan and give name to 24 hour check #Patch Set 6 : self-review #Patch Set 7 : rebase #
Total comments: 4
Patch Set 8 : review comments #Patch Set 9 : fix DCHECK #Messages
Total messages: 37 (13 generated)
|