Fix duplicate OnRunningStateChanged notification for the same version_id
When ServiceWorkerContextCore::DeleteAndStartOver() is used, the existing service workers still exist for a short time but new instances are created and they will reuse existing version_id because the count is reset to kInvalidServiceWorkerVersionId. This leads to multiple running notifications for indifferentiable service workers. To fix this, the ServiceWorkerContextWrapper is notified when DeleteAndStartOver() is called and prematurely sends a stopped notification for all currently running service worker versions. Then, to prevent future notifications from all the old versions, the ServiceWorkerContextCore silently drops notifications if the core associated with the version is no longer alive. Bug: 993029 Change-Id: I27b192141265828139416abb37d8e0c762308679 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829865 Commit-Queue: Patrick Monette <pmonette@chromium.org> Reviewed-by:Matt Falkenhagen <falken@chromium.org> Cr-Commit-Position: refs/heads/master@{#701448}
Showing
Please register or sign in to comment