[webkit-changes] [WebKit/WebKit] e323dc: Add ability to settle a NativePromise with a funct...

Jean-Yves Avenard noreply at github.com
Tue Mar 5 17:13:42 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e323dca2b77f79cb09bfc9f457f721deac22c845
      https://github.com/WebKit/WebKit/commit/e323dca2b77f79cb09bfc9f457f721deac22c845
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M Source/WTF/wtf/NativePromise.h
    M Tools/TestWebKitAPI/Tests/WTF/NativePromise.cpp

  Log Message:
  -----------
  Add ability to settle a NativePromise with a function which will be run on the dispatcher given to then/whenSettled
https://bugs.webkit.org/show_bug.cgi?id=270282
rdar://123830373

Reviewed by Youenn Fablet.

We add a settleWithFunction method to NativePromiseProducer.
For convenience, you can also pass the Function to settle().
The function provided will be run for in listener's dispatcher
and the result be then passed to the callback.

Fly-by: Make accessing the promise's result more explicit (such as when is the result accessed by reference or being moved)

Added API tests.

* Source/WTF/wtf/NativePromise.h:
* Tools/TestWebKitAPI/Tests/WTF/NativePromise.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/275720@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list