diff options
| author | Morten Sørvig <morten.sorvig@qt.io> | 2024-10-30 12:07:09 +0100 |
|---|---|---|
| committer | Morten Sørvig <morten.sorvig@qt.io> | 2025-03-03 18:24:43 +0100 |
| commit | 3c72f997705d4c4b5284433b546e447b3df4915f (patch) | |
| tree | cc8eb0228be0591099ae2f6ef1bb8635430373e9 /src/plugins/platforms/wasm/qwasmintegration.cpp | |
| parent | 94e19f42e80fdd8bc03c2f83b351e9662cdac8a8 (diff) | |
wasm: introduce QWasmSuspendResumeControl
QWasmSuspendResumeControl manages transfer of control from
JS to the wasm instance, when the wasm instance is asyncify
suspended.
Supported use cases include registerEventHandler()-type
event handlers, and also JS APIs which take a callback
functions, such as timers and requrestAnimationFrame.
The specific use cases are handled by adapters (not included
in this commit), which call the QWasmSuspendResumeControl API to
register JS/C++ event handler pairs:
uint32_t index = control->registerEventHandler([](val){ ... });
val jsHandler = control->jsEventHandler(index);
The C++ handler contains the user code, while the JS handler
can be passed to registerEventHandler or be used as a callback.
Change-Id: Ia1b1fd8884f0906759690dc7bc949c65a0248618
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmintegration.cpp')
0 files changed, 0 insertions, 0 deletions
