Bug 262872

Summary: [NativePromise] Shouldn't require to copy the resolved value when the promise isn't exclusive
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: Web Template FrameworkAssignee: 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: 262989    

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.