Service worker registration soft updates happen too frequently
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 18:47:51 +0000 (18:47 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 18:47:51 +0000 (18:47 +0000)
commitcf89e5aa55b82b6f965a8af014cc502222d70659
tree6d5dae656808166911b44453eed0c0a1ff343a56
parentf04b7fe9dd487ad0820b22c81149c145edcf3293
Service worker registration soft updates happen too frequently
https://bugs.webkit.org/show_bug.cgi?id=182296
<rdar://problem/37031862>

Reviewed by Youenn Fablet.

Move code that updates the registration's last update check time from after
the script bytecheck to before, as per:
- https://w3c.github.io/ServiceWorker/#update (step 7.19)

This way, the last update check time gets updated even if the newly fetched
script is identical to the previous one, which is the common case.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServerJobQueue.cpp