Fix internal build after r243829
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Apr 2019 23:21:04 +0000 (23:21 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Apr 2019 23:21:04 +0000 (23:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196549

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
Some SDK's don't include this selector in the header.
Use NSSelectorFromString.

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

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

index c0cb03c..c6279f0 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-03  Alex Christensen  <achristensen@webkit.org>
+
+        Fix internal build after r243829
+        https://bugs.webkit.org/show_bug.cgi?id=196549
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+        Some SDK's don't include this selector in the header.
+        Use NSSelectorFromString.
+
 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
 
         [CMake][WTF] Mirror XCode header directories
index 0ce138f..acb05ed 100644 (file)
@@ -49,6 +49,7 @@
 #import <pal/spi/cf/CFNetworkSPI.h>
 #import <wtf/MainThread.h>
 #import <wtf/NeverDestroyed.h>
+#import <wtf/ObjCRuntimeExtras.h>
 #import <wtf/ProcessPrivilege.h>
 #import <wtf/URL.h>
 #import <wtf/text/WTFString.h>
@@ -946,8 +947,9 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkProcess& networkProcess, Network
     configuration._companionProxyPreference = NSURLSessionCompanionProxyPreferencePreferDirectToCloud;
 #endif
 
-    if (parameters.allowsTLSFallback == AllowsTLSFallback::No && [configuration respondsToSelector:@selector(_allowsTLSFallback)])
-        configuration._allowsTLSFallback = NO;
+    static SEL allowsTLSFallbackSetter = NSSelectorFromString(@"set_allowsTLSFallback");
+    if (parameters.allowsTLSFallback == AllowsTLSFallback::No && [configuration respondsToSelector:allowsTLSFallbackSetter])
+        wtfObjCMsgSend<void>(configuration, allowsTLSFallbackSetter, NO);
 
     auto* storageSession = networkProcess.storageSession(parameters.sessionID);
     RELEASE_ASSERT(storageSession);