Bug 262872 - [NativePromise] Shouldn't require to copy the resolved value when the promise isn't exclusive
Summary: [NativePromise] Shouldn't require to copy the resolved value when the promise...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 262989
  Show dependency treegraph
 
Reported: 2023-10-08 23:33 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-10-11 23:22 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-10-08 23:33:59 PDT
Right now, when chaining promises that aren't exclusive, it requires to copy the resolve/reject value from one promise to the other as the promise itself owns the data that will be passed around.

This prevents being able to chain promises for objects that do not have a copy constructor (like unique_ptr).

Instead, we could either have the chained promise keeps a reference to the original promise, or store the data in a refcounted container and share that across instead.
Comment 1 Radar WebKit Bug Importer 2023-10-08 23:34:16 PDT
<rdar://problem/116664254>
Comment 2 Jean-Yves Avenard [:jya] 2023-10-09 07:47:45 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18840
Comment 3 EWS 2023-10-11 23:22:41 PDT
Committed 269241@main (c1b873c21745): <https://commits.webkit.org/269241@main>

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