On 2025-02-17 19:12, Alex Christensen via webkit-dev wrote:
Since the introduction of WKDownload in 2020, I’ve been trying to make the download object creation process asynchronous in WebKit. With 290510@main I’ve removed the last caller of WebProcessPool::download from the Cocoa platform, but I noticed that the glib APIs have 3 places where a WebKitDownload* object is returned synchronously from an API call: webkit_web_context_download_uri, webkit_web_view_download_uri, and webkit_network_session_download_uri. Would the maintainers of these APIs be willing to deprecate and remove them in favor of an API design closer to WKWebView’s startDownloadUsingRequest:completionHandler:? That function is given a callback which asynchronously provides the download object to the API client. It would also be nice if webkit_download_cancel could be reshaped to look more like WKDownload.cancel: and stop using legacyDidCancel.
Here is the first step, adding an async API to GLib: https://github.com/WebKit/WebKit/pull/42334