Bug 221639 - Use CompletionHandler instead of DataCallback
Summary: Use CompletionHandler instead of DataCallback
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-09 16:01 PST by Alex Christensen
Modified: 2021-02-18 15:59 PST (History)
6 users (show)

See Also:


Attachments
Patch (34.00 KB, patch)
2021-02-09 16:01 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (34.23 KB, patch)
2021-02-09 16:57 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (36.11 KB, patch)
2021-02-09 17:23 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (37.82 KB, patch)
2021-02-09 20:50 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (38.13 KB, patch)
2021-02-09 21:16 PST, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-02-09 16:01:26 PST
Use CompletionHandler instead of DataCallback
Comment 1 Alex Christensen 2021-02-09 16:01:53 PST
Created attachment 419779 [details]
Patch
Comment 2 Alex Christensen 2021-02-09 16:57:20 PST
Created attachment 419786 [details]
Patch
Comment 3 Alex Christensen 2021-02-09 17:23:12 PST
Created attachment 419790 [details]
Patch
Comment 4 EWS Watchlist 2021-02-09 17:24:04 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Alex Christensen 2021-02-09 20:50:35 PST
Created attachment 419809 [details]
Patch
Comment 6 Alex Christensen 2021-02-09 21:16:44 PST
Created attachment 419812 [details]
Patch
Comment 7 Alex Christensen 2021-02-09 21:21:26 PST
http://trac.webkit.org/r272636
Comment 8 Radar WebKit Bug Importer 2021-02-09 21:22:15 PST
<rdar://problem/74174432>
Comment 9 Carlos Garcia Campos 2021-02-10 07:02:51 PST
Comment on attachment 419812 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=419812&action=review

> Source/WebKit/UIProcess/API/glib/WebKitWebResource.cpp:-351
> -    if (error != CallbackBase::Error::None) {
> -        // This fails when the page is closed or frame is destroyed, so we can just cancel the operation.
> -        g_task_return_new_error(task, G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled"));
> -        return;
> -    }

We need to bring this back to fix bug #221672. I think the equivalent now would be to just null check wkData
Comment 10 Alex Christensen 2021-02-18 15:59:22 PST
Comment on attachment 419812 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=419812&action=review

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:2523
> +        completionHandler(wrapper(*data), nil);

This was a little optimistic.  See https://bugs.webkit.org/show_bug.cgi?id=222139