| Summary: | Add SPI _WKDataTask | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||||||||||
| Component: | Page Loading | Assignee: | Alex Christensen <achristensen> | ||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||
| Severity: | Normal | CC: | beidson, benjamin, cdumez, cmarcelo, ews-watchlist, thorton, webkit-bug-importer | ||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||
| OS: | Unspecified | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Alex Christensen
2022-02-25 21:35:43 PST
Created attachment 453286 [details]
Patch
Created attachment 453287 [details]
Patch
Created attachment 453293 [details]
Patch
Created attachment 453294 [details]
Patch
Comment on attachment 453294 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453294&action=review > Source/WebKit/UIProcess/API/Cocoa/_WKDataTask.h:41 > +// Calling this will often delegate's dataTask:didCompleteWithError: with { NSURLErrorDomain, NSURLErrorCancelled } often? Comment on attachment 453294 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=453294&action=review > Source/WebKit/NetworkProcess/cocoa/WKURLSessionTaskDelegate.mm:76 > +- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request completionHandler:(void (^)(NSURLRequest * _Nullable))completionHandler No nullability in implementation files (because it's viral). > Source/WebKit/UIProcess/API/APIDataTask.cpp:56 > + , m_client(DataTaskClient::create()) { } Odd place for those curly braces > Source/WebKit/UIProcess/API/APIDataTaskClient.h:50 > + virtual void willPerformHTTPRedirection(DataTask&, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&, CompletionHandler<void(bool)>&& completionHandler) const { completionHandler(true); } Is `HTTP` proper WebKit style or `Http`? (I like the all-caps version but I think WebKit style does not) > Source/WebKit/UIProcess/API/Cocoa/_WKDataTaskDelegate.h:51 > +- (void)dataTask:(_WKDataTask *)dataTask didCompleteWithError:(nullable NSError *)error; Why both nullable and _Nullable? Probably should get a Brady review too (In reply to Tim Horton from comment #6) > > Source/WebKit/UIProcess/API/Cocoa/_WKDataTaskDelegate.h:51 > > +- (void)dataTask:(_WKDataTask *)dataTask didCompleteWithError:(nullable NSError *)error; > > Why both nullable and _Nullable? nullable for selector parameters, _Nullable for block parameters I think I'm also going to make the delegate strong until cancelled or completed, kind of like NSURLSessionTask, and I'll make cancel give you no more callbacks. Created attachment 453528 [details]
Patch
Created attachment 453571 [details]
Patch
Committed r290722 (247969@main): <https://commits.webkit.org/247969@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 453571 [details]. |