mirror of
https://github.com/servo/servo
synced 2026-05-09 08:32:31 +02:00
We introduce a new type of callback, LazyGenericCallback and use it in websocket initialization. The basic requirement is that for websocket the place where the callback is called and where it is constructed are over several functions, including async functions. To make this generic, we implement LazyGenericCallback and a GeneralCallbackSetter. The CallbackSetter can be used to set the callback which then will be transfered to the LazyGenericCallback which calls it on messages send to it. Finally, we use this to "Generify" the initialization of WebSockets. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Testing: We have new tests for LazyGenericCallback and wpt test run here: https://github.com/Narfinger/servo/actions/runs/21246091767 --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>