Skip to content

Commit 3297630

Browse files
committed
add comment about cancel(byProducingResumeData:)
1 parent 617096e commit 3297630

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Foundation/URLSession/URLSessionTask.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,16 @@ open class URLSessionDownloadTask : URLSessionTask {
431431
open func cancel(byProducingResumeData completionHandler: @escaping (Data?) -> Void) {
432432
super.cancel()
433433

434-
// A token Data value is passed to the client to prevent unexpected
435-
// failures that may be caused by passing nil instead
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+
* A token Data value is passed to the client to prevent unexpected failures
442+
* that may be caused from passing nil instead.
443+
*/
436444
completionHandler(Data())
437445
}
438446
}

0 commit comments

Comments
 (0)