Closed Bug 1450416 Opened 6 years ago Closed 6 years ago

setTimeout/setInterval should silently fail if the worker is shutting down

Categories

(Core :: DOM: Workers, enhancement)

58 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: baku, Assigned: baku)

Details

Attachments

(1 file)

We currently say it, but we don't and we throw an exception:
https://searchfox.org/mozilla-central/source/dom/workers/WorkerPrivate.cpp#4578-4583
Attached patch timeout.patchSplinter Review
Attachment #8964095 - Flags: review?(bugmail)
Comment on attachment 8964095 [details] [diff] [review]
timeout.patch

Review of attachment 8964095 [details] [diff] [review]:
-----------------------------------------------------------------

Restating:
- The tests under testing/web-platform/tests/workers/interfaces/WorkerUtils/WindowTimers/ use a weird idiom where the HTML file is also interepreted as the JS worker script, which is terrifying.
- Test test passes if setInterval() on an already self.close()d worker doesn't throw and skip the postMessage call.
- These changes are consistent with the spec at https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps (and slightly above), which don't call for throwing if the global is shutting down.
- It makes sense that shutdown of a worker wants to quietly shutdown, rather than causing a sudden massive deviation from the steady-state behavior.
Attachment #8964095 - Flags: review?(bugmail) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b537ebde3ae1
setTimeout/setInterval should silently fail if the worker is shutting down, r=asuth
https://hg.mozilla.org/mozilla-central/rev/b537ebde3ae1
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/10308 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: