Bug 270282
| Summary: | Add ability to settle a NativePromise with a function which will be run on the dispatcher given to then/whenSettled | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Web Template Framework | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | kkinnunen, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 270118 | ||
| Bug Blocks: | 270320 | ||
Jean-Yves Avenard [:jya]
In bug 270118 we added the possibility to specify the SerialFunctionDispatcher on which the IPC's Decoder was going to run on.
But this is separated from the SerialFunctionDispatcher given to then/whenSettled and so you end up with a syntax call like:
sendWithPromisedReplyOnDispatcher(message, workQueue())->whenSettled(workQueue(), [] { ... });
You need to set workQueue twice, it would be much more intuitive to simply do something like:
sendWithPromisedReplyOnDispatcher(message)->whenSettled(workQueue(), [] { ... });
and the Connection would deliver the decoder directly to the promise.
One of the issue here is that the time sendWithPromisedReplyOnDispatcher is called, no listener (created with whenSettled) would be attach yet. So no WorkQueue set.
What we could have instead is a way to settle a promise with a pending CompletionHandler which would only be called once whenSettled/then is called, and would run that CompletionHandler on the target dispatcher rather than immediately.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/123830373>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/25295
EWS
Committed 275720@main (e323dca2b77f): <https://commits.webkit.org/275720@main>
Reviewed commits have been landed. Closing PR #25295 and removing active labels.