gecko-dev/dom/worklet
Iain Ireland 5617e628be Bug 1467846: Part 10: Introduce DelayedDispatchToEventLoopCallback r=arai,dom-worker-reviewers,smaug
[Atomics.waitAsync](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/waitAsync) creates a promise that can be resolved via Atomics.notify, or after an optional timeout. The timeout is [implemented](https://html.spec.whatwg.org/multipage/webappapis.html#hostenqueuetimeoutjob) using the [HostEnqueueTimeoutJob hook](https://html.spec.whatwg.org/multipage/webappapis.html#hostenqueuetimeoutjob), which queues a global task (not a microtask).

This patch adds a new API (DelayedDispatchToEventLoopCallback) accessible by the JS engine that utilized the TimeoutManager for executing the steps outlined in the HostEnqueTimeoutJob. Unlike DispatchToEventCallback, this is currently restricted to only threads which support TimeoutManager (the Main thread and the Workers Thread). This should not be enabled on worklets per the discussion [here](https://phabricator.services.mozilla.com/D212876#inline-1206374). The next patch adds an implementation in worker threads. A later patch in the stack adds an implementation for the shell.

Depends on D212875

Differential Revision: https://phabricator.services.mozilla.com/D212876
2025-05-13 10:04:54 +00:00
..
loader Bug 1954644 - Part 3: Cleanup ModuleLoadRequest parameters to avoid confusing parameter syntax. r=nbp 2025-03-22 04:03:54 +00:00
tests
moz.build
Worklet.cpp
Worklet.h Bug 1951240 - Implement AudioWorklet.port, r=padenot,webidl,saschanaz 2025-03-03 14:35:51 +00:00
WorkletFetchHandler.cpp Bug 1954644 - Part 3: Cleanup ModuleLoadRequest parameters to avoid confusing parameter syntax. r=nbp 2025-03-22 04:03:54 +00:00
WorkletFetchHandler.h
WorkletGlobalScope.cpp
WorkletGlobalScope.h Bug 1964489 - Avoid duplication in NS_DECLARE_STATIC_IID_ACCESSOR / NS_DEFINE_STATIC_IID_ACCESSOR r=nika,necko-reviewers,media-playback-reviewers,places-reviewers,win-reviewers,dom-storage-reviewers,xpcom-reviewers,gstoll,janv,emilio,padenot,valentin,asuth 2025-05-08 08:05:51 +00:00
WorkletImpl.cpp Bug 1951240 - Implement AudioWorklet.port, r=padenot,webidl,saschanaz 2025-03-03 14:35:51 +00:00
WorkletImpl.h Bug 1951240 - Implement AudioWorklet.port, r=padenot,webidl,saschanaz 2025-03-03 14:35:51 +00:00
WorkletThread.cpp Bug 1467846: Part 10: Introduce DelayedDispatchToEventLoopCallback r=arai,dom-worker-reviewers,smaug 2025-05-13 10:04:54 +00:00
WorkletThread.h