Bug 262437 - NativePromise should provide a safe way to pass some argument types
Summary: NativePromise should provide a safe way to pass some argument types
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:
 
Reported: 2023-09-30 00:34 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-10-04 16:21 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-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.