Bug 212110 - Add _WKDownloadDelegate callback including totalBytesWritten
Summary: Add _WKDownloadDelegate callback including totalBytesWritten
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: 2020-05-19 15:56 PDT by Alex Christensen
Modified: 2020-05-19 17:27 PDT (History)
8 users (show)

See Also:


Attachments
Patch (22.66 KB, patch)
2020-05-19 16:00 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (23.47 KB, patch)
2020-05-19 16:09 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (23.28 KB, patch)
2020-05-19 16:13 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (24.30 KB, patch)
2020-05-19 16:16 PDT, 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 2020-05-19 15:56:40 PDT
Add _WKDownloadDelegate callback including totalBytesWritten
Comment 1 Alex Christensen 2020-05-19 16:00:41 PDT
Created attachment 399778 [details]
Patch
Comment 2 Alex Christensen 2020-05-19 16:00:43 PDT
<rdar://problem/63358981>
Comment 3 Alex Christensen 2020-05-19 16:09:45 PDT
Created attachment 399779 [details]
Patch
Comment 4 Alex Christensen 2020-05-19 16:13:52 PDT
Created attachment 399780 [details]
Patch
Comment 5 Alex Christensen 2020-05-19 16:16:44 PDT
Created attachment 399781 [details]
Patch
Comment 6 EWS Watchlist 2020-05-19 16:17:35 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 7 Geoffrey Garen 2020-05-19 17:15:07 PDT
Comment on attachment 399781 [details]
Patch

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

r=me

> Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.mm:49
> +- (void)_download:(_WKDownload *)download didWriteData:(uint64_t)bytesWritten totalBytesWritten:(uint64_t)totalBytesWritten totalBytesExpectedToWrite:(uint64_t)totalBytesExpectedToWrite

I wonder if we can keep the didReceive naming pattern, to match the rest of the API and other networking APIs.

didReceiveBytes:(uint64_t)bytes totalBytes:(uint64_t)totalBytes totalBytesExpected:(uint64_t)totalBytesExpected
Comment 8 Alex Christensen 2020-05-19 17:18:01 PDT
Comment on attachment 399781 [details]
Patch

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

>> Tools/TestWebKitAPI/cocoa/TestDownloadDelegate.mm:49
>> +- (void)_download:(_WKDownload *)download didWriteData:(uint64_t)bytesWritten totalBytesWritten:(uint64_t)totalBytesWritten totalBytesExpectedToWrite:(uint64_t)totalBytesExpectedToWrite
> 
> I wonder if we can keep the didReceive naming pattern, to match the rest of the API and other networking APIs.
> 
> didReceiveBytes:(uint64_t)bytes totalBytes:(uint64_t)totalBytes totalBytesExpected:(uint64_t)totalBytesExpected

Downloads are not like other networking APIs.  This callback is not called until the data is written to disk, just like the CFNetwork callback.  There is a time between when the bytes are received and when they are written, and this should not be called during that time.
Comment 9 Alex Christensen 2020-05-19 17:18:37 PDT
It was a mistake to use the name didWriteData before and this fixes that mistake.
Comment 10 EWS 2020-05-19 17:27:24 PDT
Committed r261898: <https://trac.webkit.org/changeset/261898>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399781 [details].