Don't call CFURLRequestSetShouldStartSynchronously from Catalyst WebKit
https://bugs.webkit.org/show_bug.cgi?id=206446
<rdar://problem/57382980>

Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-17
Reviewed by Tim Horton.

We call it sometimes on iOS but Catalyst WebKit uses macOS CFNetwork, which doesn't like starting synchronously.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 78d9053..8ad285a 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2020-01-17  Alex Christensen  <achristensen@webkit.org>
+
+        Don't call CFURLRequestSetShouldStartSynchronously from Catalyst WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=206446
+        <rdar://problem/57382980>
+
+        Reviewed by Tim Horton.
+
+        We call it sometimes on iOS but Catalyst WebKit uses macOS CFNetwork, which doesn't like starting synchronously.
+
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::createNSURLConnection):
+
 2020-01-17  Eric Carlson  <eric.carlson@apple.com>
 
         REGRESSION (r254483): media/track/track-cues-sorted-before-dispatch.html became very flaky
diff --git a/Source/WebCore/platform/network/mac/ResourceHandleMac.mm b/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
index 61a67ef..03fa268 100644
--- a/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -95,7 +95,7 @@
     LOG(Network, "Handle %p destroyed", this);
 }
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
 
 static bool synchronousWillSendRequestEnabled()
 {
@@ -207,8 +207,10 @@
     NSMutableDictionary *propertyDictionary = [NSMutableDictionary dictionaryWithDictionary:connectionProperties];
     [propertyDictionary setObject:streamProperties forKey:@"kCFURLConnectionSocketStreamProperties"];
     const bool usesCache = false;
+#if !PLATFORM(MACCATALYST)
     if (synchronousWillSendRequestEnabled())
         CFURLRequestSetShouldStartSynchronously([nsRequest _CFURLRequest], 1);
+#endif
 #else
     NSMutableDictionary *propertyDictionary = [NSMutableDictionary dictionaryWithObject:streamProperties forKey:@"kCFURLConnectionSocketStreamProperties"];
     const bool usesCache = true;