RESOLVED FIXED261720
Give ability for IPC calls to work with NativePromise
https://bugs.webkit.org/show_bug.cgi?id=261720
Summary Give ability for IPC calls to work with NativePromise
Jean-Yves Avenard [:jya]
Reported 2023-09-18 21:10:10 PDT
Would give the ability to instead of doing: ``` m_connectionToWebProcess->connection().sendWithAsyncReply(Messages::MediaSourcePrivateRemote::WaitForTarget(target), WTFMove(completionHandler), m_identifier); ``` you could instead do: ``` m_connectionToWebProcess->connection().sendWithPromisedReply(Messages::MediaSourcePrivateRemote::WaitForTarget(target), m_identifier) ->whenSettled(runLoop, __func__, [] (MediaSourcePrivateRemote::WaitForTarget::Promise::Result&& result) { if (result) // do something with result.value() else // do something with result.error() }); ``` this would also gives the ability to propagate the IPC error, see bug 257934 It also allows to guarantee on which thread the completionHandler will run once the IPC operation has returned its value.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-09-18 21:12:48 PDT
Jean-Yves Avenard [:jya]
Comment 2 2023-09-20 00:45:36 PDT
EWS
Comment 3 2023-09-21 00:53:26 PDT
Committed 268240@main (f997a9edb80c): <https://commits.webkit.org/268240@main> Reviewed commits have been landed. Closing PR #17965 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.