forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ServiceWorker: Start the timer immediately after queuing an event
This CL tries to re-land the CL (1) which was reverted by the issue (2). (1) https://chromium-review.googlesource.com/c/chromium/src/+/2423698 (2) https://crbug.com/1134552 This CL mainly does the following things: 1) Make the timer start immediately after an event is enqueued, and erases the event from the queue when it has not started to run yet and the timeout happens. 2) Update kUpdateInterval because the minimum possible timeout is 10 seconds for offline events. 3) Set a callback to a hashmap (e.g. fetch_event_callbacks_) before calling EnqueueNormal/Pending/Offline() in SWGlobalScope. The change 3) is needed to fix the issue (2). An abort callback is possibly called before an event is started to run due to the change 1). However, previously, an event_id and a callback were set to a hashmap when a start_callback was called, so if an event was aborted before it starts, a hashmap didn't have a callback yet. Bug: 965802 Change-Id: Ic177e8aaab25527b3fa0b7a07aae51fca484bf85 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460747 Commit-Queue: Asami Doi <asamidoi@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Makoto Shimazu <shimazu@chromium.org> Cr-Commit-Position: refs/heads/master@{#817385}
- Loading branch information
Showing
5 changed files
with
286 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.