File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ There is no _Complete_ status for test coverage because there are always additio
8181 | ` URLSessionTask ` | Mostly Complete | Incomplete | ` cancel() ` , ` createTransferState(url:) ` with streams, and others remain unimplemented |
8282 | ` URLSessionDataTask ` | Complete | Incomplete | |
8383 | ` URLSessionUploadTask ` | Complete | None | |
84- | ` URLSessionDownloadTask ` | Incomplete | Incomplete | ` cancel(byProducingResumeData:) ` remains unimplemented |
84+ | ` URLSessionDownloadTask ` | Incomplete | Incomplete | |
8585 | ` URLSessionStreamTask ` | Unimplemented | None | |
8686 | ` TaskRegistry ` | N/A | N/A | For internal use only |
8787 | ` TransferState ` | N/A | N/A | For internal use only |
Original file line number Diff line number Diff line change @@ -428,7 +428,18 @@ open class URLSessionDownloadTask : URLSessionTask {
428428 * If resume data cannot be created, the completion handler will be
429429 * called with nil resumeData.
430430 */
431- open func cancel( byProducingResumeData completionHandler: @escaping ( Data ? ) -> Void ) { NSUnimplemented ( ) }
431+ open func cancel( byProducingResumeData completionHandler: @escaping ( Data ? ) -> Void ) {
432+ super. cancel ( )
433+
434+ /*
435+ * In Objective-C, this method relies on an Apple-maintained XPC process
436+ * to manage the bookmarking of partially downloaded data. Therefore, the
437+ * original behavior cannot be directly ported, here.
438+ *
439+ * Instead, we just call the completionHandler directly.
440+ */
441+ completionHandler ( nil )
442+ }
432443}
433444
434445/*
You can’t perform that action at this time.
0 commit comments