Bug 254502
| Summary: | Implement NativePromise / WTFPromise | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Media | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 261601 | ||
Jean-Yves Avenard [:jya]
In the media code, we queue a lot of tasks to be run later once a previous task has completed.
We currently do this with the use of CompletionHandler but this becomes cumbersome once more than two tasks are still pending.
This is particularly visible if we want to fix bug 254079. The alternative is to keep queues of operations to run.
Mozilla successfully implemented MozPromise which became thoroughly used in their code. It makes for easy to ready asynchronous code and remove all guesses on which thread a completion task may run.
Which should have a similar object.
We could then do promise1->then(thread, []() { taskToRun1(); })->then(thread, []() { taskToRun2(); })
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/107546076>
Jean-Yves Avenard [:jya]
Pull request: https://github.com/WebKit/WebKit/pull/17344
Jean-Yves Avenard [:jya]
Renamed as per Youenn's suggestion.
EWS
Committed 268120@main (a53ad484a1c9): <https://commits.webkit.org/268120@main>
Reviewed commits have been landed. Closing PR #17344 and removing active labels.