Make download resume workaround forgiving of changes in CFNetwork
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 May 2020 22:43:39 +0000 (22:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 May 2020 22:43:39 +0000 (22:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=212273

Patch by Alex Christensen <achristensen@webkit.org> on 2020-05-22
Reviewed by Geoffrey Garen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

They broke my workaround.  See rdar://problem/63512518

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Download.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@262084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/Download.mm

index 6ceb9b6..8e6585e 100644 (file)
@@ -1,3 +1,12 @@
+2020-05-22  Alex Christensen  <achristensen@webkit.org>
+
+        Make download resume workaround forgiving of changes in CFNetwork
+        https://bugs.webkit.org/show_bug.cgi?id=212273
+
+        Reviewed by Geoffrey Garen.
+
+        * pal/spi/cf/CFNetworkSPI.h:
+
 2020-05-22  Andy Estes  <aestes@apple.com>
 
         [Apple Pay] Add new ApplePayInstallmentConfiguration members
index 65a9a7d..f2f95b9 100644 (file)
@@ -425,7 +425,7 @@ WTF_EXTERN_C_END
 - (void)_setCookiesRemovedHandler:(void(^__nullable)(NSArray<NSHTTPCookie*>* __nullable removedCookies, NSString* __nullable domainForRemovedCookies, bool removeAllCookies))cookiesRemovedHandler onQueue:(dispatch_queue_t __nullable)queue;
 @end
 
-@interface __NSCFLocalDownloadFile
+@interface __NSCFLocalDownloadFile : NSObject
 @end
 @interface __NSCFLocalDownloadFile ()
 @property (readwrite, assign) BOOL skipUnlink;
index 1fb20b6..5bc6132 100644 (file)
@@ -1,3 +1,15 @@
+2020-05-22  Alex Christensen  <achristensen@webkit.org>
+
+        Make download resume workaround forgiving of changes in CFNetwork
+        https://bugs.webkit.org/show_bug.cgi?id=212273
+
+        Reviewed by Geoffrey Garen.
+
+        They broke my workaround.  See rdar://problem/63512518
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
+
 2020-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [IPC] Add support for specifying `Async WantsConnection` in message files
index baba47c..ae00cd2 100644 (file)
@@ -957,7 +957,8 @@ static inline void processServerTrustEvaluation(NetworkSessionCocoa& session, Se
 {
 #if PLATFORM(IOS_FAMILY)
     // This is to work around rdar://problem/63249830
-    downloadTask.downloadFile.skipUnlink = YES;
+    if ([downloadTask respondsToSelector:@selector(downloadFile)] && [downloadTask.downloadFile respondsToSelector:@selector(setSkipUnlink:)])
+        downloadTask.downloadFile.skipUnlink = YES;
 #endif
 }
 
index a20bb80..92bd4ef 100644 (file)
@@ -1,3 +1,12 @@
+2020-05-22  Alex Christensen  <achristensen@webkit.org>
+
+        Make download resume workaround forgiving of changes in CFNetwork
+        https://bugs.webkit.org/show_bug.cgi?id=212273
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/Download.mm:
+
 2020-05-22  Paulo Matos  <pmatos@igalia.com>
 
         Add support for [no-]use-ccache option in build-jsc
index 120753f..85a6247 100644 (file)
@@ -1160,7 +1160,8 @@ TEST(_WKDownload, ResumedDownloadCanHandleAuthenticationChallenge)
     Util::run(&isDone);
 }
 
-#if HAVE(NETWORK_FRAMEWORK)
+// FIXME: Enable this everywhere once rdar://problem/63249830 or rdar://problem/63512518 is fixed.
+#if HAVE(NETWORK_FRAMEWORK) && (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 140000))
 
 template<size_t length>
 String longString(LChar c)