Bug 212110

Summary: Add _WKDownloadDelegate callback including totalBytesWritten
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, cdumez, cgarcia, ews-watchlist, ggaren, gustavo, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

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].