Bug 254502 - Implement NativePromise / WTFPromise
Summary: Implement NativePromise / WTFPromise
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 261601
  Show dependency treegraph
 
Reported: 2023-03-27 00:16 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-09-19 06:06 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-03-27 00:16:54 PDT
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(); })
Comment 1 Radar WebKit Bug Importer 2023-04-03 00:17:14 PDT
<rdar://problem/107546076>
Comment 2 Jean-Yves Avenard [:jya] 2023-09-01 06:25:36 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17344
Comment 3 Jean-Yves Avenard [:jya] 2023-09-05 09:44:57 PDT
Renamed as per Youenn's suggestion.
Comment 4 EWS 2023-09-19 06:06:17 PDT
Committed 268120@main (a53ad484a1c9): <https://commits.webkit.org/268120@main>

Reviewed commits have been landed. Closing PR #17344 and removing active labels.