Make service worker's idle timer more precise to take arbitrary delay
The service worker's idle timeout is triggered when the service worker is idle for a certain period of time. Previously, the idleness is checked periodically on UpdateStatus() in ServiceWorkerEventQueue. However, the periodic check prevents us from introducing arbitrary delay of idle timeout because the delay is quantized by the interval of the periodic check. This CL re-implements the idleness check by using delayed cancellable callback. In the new implementation, the idle callback is scheduled immediately after the worker has no inflight event. If we get another event before calling the scheduled callback, it's cancelled. Bug: 1043845 Change-Id: I0d8950ced2e2465ef3d1bd88c7c499fb2c78f609 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2019142 Commit-Queue: Makoto Shimazu <shimazu@chromium.org> Reviewed-by:Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#735793}
Showing
This diff is collapsed.
Please register or sign in to comment