Bug 262437

Summary: NativePromise should provide a safe way to pass some argument types
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   
See Also: https://bugs.webkit.org/show_bug.cgi?id=262660

Description Jean-Yves Avenard [:jya] 2023-09-30 00:34:21 PDT
Currently, it's up to the NativePromise producer and callback to deal with object that can only ever exists on a single thread at the same time (like WTFString or Exception).

Ideally, the NativePromise could automatically deal with those objects and call isolatedCopy() or crossThreadyCopy() automatically.

One way would be to wrap all results in a `ParameterStorage` class that would automatically have a store and load method that deal with the required calls as needed.
Comment 1 Radar WebKit Bug Importer 2023-09-30 00:34:39 PDT
<rdar://problem/116274506>
Comment 2 Jean-Yves Avenard [:jya] 2023-10-01 02:15:46 PDT
Actually, there's already `crossThreadCopy()` utility that stores data in a CrossThreadCopier class.

we will use that (will need additional specialisation)
Comment 3 Jean-Yves Avenard [:jya] 2023-10-01 22:52:38 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18484
Comment 4 EWS 2023-10-04 16:21:06 PDT
Committed 268880@main (0345168e97b5): <https://commits.webkit.org/268880@main>

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