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
81
81
| ` URLSessionTask ` | Mostly Complete | Incomplete | ` cancel() ` , ` createTransferState(url:) ` with streams, and others remain unimplemented |
82
82
| ` URLSessionDataTask ` | Complete | Incomplete | |
83
83
| ` URLSessionUploadTask ` | Complete | None | |
84
- | ` URLSessionDownloadTask ` | Incomplete | Incomplete | ` cancel(byProducingResumeData:) ` remains unimplemented |
84
+ | ` URLSessionDownloadTask ` | Incomplete | Incomplete | |
85
85
| ` URLSessionStreamTask ` | Unimplemented | None | |
86
86
| ` TaskRegistry ` | N/A | N/A | For internal use only |
87
87
| ` 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 {
428
428
* If resume data cannot be created, the completion handler will be
429
429
* called with nil resumeData.
430
430
*/
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
+ }
432
443
}
433
444
434
445
/*
You can’t perform that action at this time.
0 commit comments