Title: [224828] trunk/Source/WebKit
Revision
224828
Author
[email protected]
Date
2017-11-14 11:54:01 -0800 (Tue, 14 Nov 2017)

Log Message

Remove WebKit CFURLConnection code
https://bugs.webkit.org/show_bug.cgi?id=179645

Reviewed by Alexey Proskuryakov.

The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.

* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/mac/DownloadMac.mm:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::serverTrustCredential):
* NetworkProcess/mac/NetworkLoadMac.mm:
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::useCredentialForSingleChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
(WebKit::AuthenticationManager::cancelSingleChallenge):
(WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
* Shared/Authentication/mac/AuthenticationManager.mac.mm:
(WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
* config.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (224827 => 224828)


--- trunk/Source/WebKit/ChangeLog	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/ChangeLog	2017-11-14 19:54:01 UTC (rev 224828)
@@ -1,5 +1,38 @@
 2017-11-14  Alex Christensen  <[email protected]>
 
+        Remove WebKit CFURLConnection code
+        https://bugs.webkit.org/show_bug.cgi?id=179645
+
+        Reviewed by Alexey Proskuryakov.
+
+        The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.
+
+        * NetworkProcess/Downloads/Download.h:
+        * NetworkProcess/Downloads/mac/DownloadMac.mm:
+        * NetworkProcess/NetworkLoad.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::serverTrustCredential):
+        * NetworkProcess/mac/NetworkLoadMac.mm:
+        * Shared/Authentication/AuthenticationManager.cpp:
+        (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
+        (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
+        (WebKit::AuthenticationManager::cancelSingleChallenge):
+        (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
+        (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
+        * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
+        * Shared/Authentication/mac/AuthenticationManager.mac.mm:
+        (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * Shared/mac/WebCoreArgumentCodersMac.mm:
+        (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
+        (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
+        * config.h:
+
+2017-11-14  Alex Christensen  <[email protected]>
+
         Remove assertions added in r224791
         https://bugs.webkit.org/show_bug.cgi?id=178751#c10
 

Modified: trunk/Source/WebKit/NetworkProcess/Downloads/Download.h (224827 => 224828)


--- trunk/Source/WebKit/NetworkProcess/Downloads/Download.h	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/Download.h	2017-11-14 19:54:01 UTC (rev 224828)
@@ -49,10 +49,6 @@
 #endif
 #endif // USE(NETWORK_SESSION)
 
-#if USE(CFURLCONNECTION)
-#include <CFNetwork/CFURLDownloadPriv.h>
-#endif
-
 namespace IPC {
 class DataReference;
 }

Modified: trunk/Source/WebKit/NetworkProcess/Downloads/mac/DownloadMac.mm (224827 => 224828)


--- trunk/Source/WebKit/NetworkProcess/Downloads/mac/DownloadMac.mm	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/mac/DownloadMac.mm	2017-11-14 19:54:01 UTC (rev 224828)
@@ -38,44 +38,6 @@
 #import <WebCore/ResourceResponse.h>
 #import <pal/spi/cocoa/NSURLDownloadSPI.h>
 
-#if USE(CFURLCONNECTION)
-
-namespace WebKit {
-
-void Download::resume(const IPC::DataReference&, const String&, const SandboxExtension::Handle&)
-{
-    notImplemented();
-}
-
-void Download::platformDidFinish()
-{
-    notImplemented();
-}
-
-void Download::platformCancelNetworkLoad()
-{
-    notImplemented();
-}
-
-void Download::startNetworkLoadWithHandle(WebCore::ResourceHandle*, const WebCore::ResourceResponse&)
-{
-    notImplemented();
-}
-
-void Download::startNetworkLoad()
-{
-    notImplemented();
-}
-
-void Download::platformInvalidate()
-{
-    notImplemented();
-}
-
-}
-
-#else
-
 @interface WKDownloadAsDelegate : NSObject <NSURLDownloadDelegate> {
     WebKit::Download* _download;
 }
@@ -314,5 +276,4 @@
 
 @end
 
-#endif // USE(CFURLCONNECTION)
 #endif // !USE(NETWORK_SESSION)

Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoad.h (224827 => 224828)


--- trunk/Source/WebKit/NetworkProcess/NetworkLoad.h	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoad.h	2017-11-14 19:54:01 UTC (rev 224828)
@@ -89,12 +89,8 @@
     void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&) override;
 #endif
 #if PLATFORM(COCOA)
-#if USE(CFURLCONNECTION)
-    void willCacheResponseAsync(WebCore::ResourceHandle*, CFCachedURLResponseRef) override;
-#else
     void willCacheResponseAsync(WebCore::ResourceHandle*, NSCachedURLResponse *) override;
 #endif
-#endif
 #endif // USE(NETWORK_SESSION)
 
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (224827 => 224828)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm	2017-11-14 19:54:01 UTC (rev 224828)
@@ -401,12 +401,7 @@
 
 WebCore::Credential serverTrustCredential(const WebCore::AuthenticationChallenge& challenge)
 {
-#if USE(CFURLCONNECTION)
-    notImplemented();
-    return { };
-#else
     return WebCore::Credential([NSURLCredential credentialForTrust:challenge.nsURLAuthenticationChallenge().protectionSpace.serverTrust]);
-#endif
 }
 
 }

Modified: trunk/Source/WebKit/NetworkProcess/mac/NetworkLoadMac.mm (224827 => 224828)


--- trunk/Source/WebKit/NetworkProcess/mac/NetworkLoadMac.mm	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/NetworkProcess/mac/NetworkLoadMac.mm	2017-11-14 19:54:01 UTC (rev 224828)
@@ -35,17 +35,6 @@
 
 using namespace WebCore;
 
-#if USE(CFURLCONNECTION)
-
-void NetworkLoad::willCacheResponseAsync(ResourceHandle* handle, CFCachedURLResponseRef cfResponse)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    m_handle->continueWillCacheResponse(cfResponse);
-}
-
-#else
-
 void NetworkLoad::willCacheResponseAsync(ResourceHandle* handle, NSCachedURLResponse *nsResponse)
 {
     ASSERT_UNUSED(handle, handle == m_handle);
@@ -53,8 +42,6 @@
     m_handle->continueWillCacheResponse(nsResponse);
 }
 
-#endif // !USE(CFURLCONNECTION)
-
 } // namespace WebKit
 
 #endif // !USE(NETWORK_SESSION)

Modified: trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (224827 => 224828)


--- trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2017-11-14 19:54:01 UTC (rev 224828)
@@ -231,7 +231,7 @@
 
     if (coreClient)
         coreClient->receivedCredential(challenge.challenge, credential);
-#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
+#if !USE(NETWORK_SESSION)
     else
         receivedCredential(challenge.challenge, credential);
 #endif
@@ -262,7 +262,7 @@
 
     if (coreClient)
         coreClient->receivedRequestToContinueWithoutCredential(challenge.challenge);
-#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
+#if !USE(NETWORK_SESSION)
     else
         receivedRequestToContinueWithoutCredential(challenge.challenge);
 #endif
@@ -293,7 +293,7 @@
 
     if (coreClient)
         coreClient->receivedCancellation(challenge.challenge);
-#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
+#if !USE(NETWORK_SESSION)
     else
         receivedCancellation(challenge.challenge);
 #endif
@@ -324,7 +324,7 @@
 
     if (coreClient)
         coreClient->receivedRequestToPerformDefaultHandling(challenge.challenge);
-#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
+#if !USE(NETWORK_SESSION)
     else
         receivedRequestToPerformDefaultHandling(challenge.challenge);
 #endif
@@ -355,7 +355,7 @@
 
     if (coreClient)
         coreClient->receivedChallengeRejection(challenge.challenge);
-#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
+#if !USE(NETWORK_SESSION)
     else
         receivedChallengeRejection(challenge.challenge);
 #endif

Modified: trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm (224827 => 224828)


--- trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm	2017-11-14 19:54:01 UTC (rev 224828)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "AuthenticationManager.h"
 
-#if !USE(CFURLCONNECTION) && !USE(NETWORK_SESSION)
+#if !USE(NETWORK_SESSION)
 using namespace WebCore;
 
 namespace WebKit {

Modified: trunk/Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm (224827 => 224828)


--- trunk/Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/Shared/Authentication/mac/AuthenticationManager.mac.mm	2017-11-14 19:54:01 UTC (rev 224828)
@@ -81,13 +81,8 @@
         LOG_ERROR("Unable to create SecIdentityRef with certificate - %i", result);
         if (completionHandler)
             completionHandler(AuthenticationChallengeDisposition::Cancel, { });
-        else {
-#if USE(CFURLCONNECTION)
-            notImplemented();
-#else
+        else
             [challenge.sender() cancelAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
-#endif
-        }
         return true;
     }
 
@@ -94,13 +89,8 @@
     NSURLCredential *credential = [NSURLCredential credentialWithIdentity:identity certificates:chain(certificateInfo) persistence:NSURLCredentialPersistenceNone];
     if (completionHandler)
         completionHandler(AuthenticationChallengeDisposition::UseCredential, Credential(credential));
-    else {
-#if USE(CFURLCONNECTION)
-        notImplemented();
-#else
+    else
         [challenge.sender() useCredential:credential forAuthenticationChallenge:challenge.nsURLAuthenticationChallenge()];
-#endif
-    }
     return true;
 }
 

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (224827 => 224828)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2017-11-14 19:54:01 UTC (rev 224828)
@@ -95,7 +95,7 @@
     encoder << textCheckerState;
     encoder << fullKeyboardAccessEnabled;
     encoder << defaultRequestTimeoutInterval;
-#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
+#if PLATFORM(COCOA)
     encoder << uiProcessBundleIdentifier;
 #endif
     encoder << presentingApplicationPID;
@@ -244,7 +244,7 @@
         return false;
     if (!decoder.decode(parameters.defaultRequestTimeoutInterval))
         return false;
-#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
+#if PLATFORM(COCOA)
     if (!decoder.decode(parameters.uiProcessBundleIdentifier))
         return false;
 #endif

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (224827 => 224828)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2017-11-14 19:54:01 UTC (rev 224828)
@@ -133,7 +133,7 @@
 
     TextCheckerState textCheckerState;
 
-#if PLATFORM(COCOA) || USE(CFURLCONNECTION)
+#if PLATFORM(COCOA)
     String uiProcessBundleIdentifier;
 #endif
 

Modified: trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm (224827 => 224828)


--- trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm	2017-11-14 19:54:01 UTC (rev 224828)
@@ -39,10 +39,6 @@
 #import <WebCore/ResourceRequest.h>
 #import <pal/spi/cf/CFNetworkSPI.h>
 
-#if USE(CFURLCONNECTION)
-#import <CFNetwork/CFURLRequest.h>
-#endif
-
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
 #import <WebCore/MediaPlaybackTargetContext.h>
 #import <objc/runtime.h>
@@ -173,39 +169,6 @@
     return WTFMove(cfRequest);
 }
 
-#if USE(CFURLCONNECTION)
-void ArgumentCoder<ResourceRequest>::encodePlatformData(Encoder& encoder, const ResourceRequest& resourceRequest)
-{
-    RetainPtr<CFURLRequestRef> requestToSerialize = resourceRequest.cfURLRequest(DoNotUpdateHTTPBody);
-
-    bool requestIsPresent = requestToSerialize;
-    encoder << requestIsPresent;
-
-    if (!requestIsPresent)
-        return;
-
-    // We don't send HTTP body over IPC for better performance.
-    // Also, it's not always possible to do, as streams can only be created in process that does networking.
-    RetainPtr<CFDataRef> requestHTTPBody = adoptCF(CFURLRequestCopyHTTPRequestBody(requestToSerialize.get()));
-    RetainPtr<CFReadStreamRef> requestHTTPBodyStream = adoptCF(CFURLRequestCopyHTTPRequestBodyStream(requestToSerialize.get()));
-    if (requestHTTPBody || requestHTTPBodyStream) {
-        CFMutableURLRequestRef mutableRequest = CFURLRequestCreateMutableCopy(0, requestToSerialize.get());
-        requestToSerialize = adoptCF(mutableRequest);
-        CFURLRequestSetHTTPRequestBody(mutableRequest, nil);
-        CFURLRequestSetHTTPRequestBodyStream(mutableRequest, nil);
-    }
-
-    RetainPtr<CFDictionaryRef> dictionary = createSerializableRepresentation(requestToSerialize.get(), IPC::tokenNullTypeRef());
-    IPC::encode(encoder, dictionary.get());
-
-    // The fallback array is part of CFURLRequest, but it is not encoded by WKCFURLRequestCreateSerializableRepresentation.
-    encoder << resourceRequest.responseContentDispositionEncodingFallbackArray();
-    encoder.encodeEnum(resourceRequest.requester());
-    encoder.encodeEnum(resourceRequest.cachePolicy());
-}
-
-#else
-
 static RetainPtr<CFDictionaryRef> createSerializableRepresentation(NSURLRequest *request, CFTypeRef tokenNull)
 {
     return createSerializableRepresentation([request _CFURLRequest], tokenNull);
@@ -246,7 +209,6 @@
     encoder.encodeEnum(resourceRequest.requester());
     encoder.encodeEnum(resourceRequest.cachePolicy());
 }
-#endif
 
 bool ArgumentCoder<ResourceRequest>::decodePlatformData(Decoder& decoder, ResourceRequest& resourceRequest)
 {
@@ -263,19 +225,11 @@
     if (!IPC::decode(decoder, dictionary))
         return false;
 
-#if USE(CFURLCONNECTION)
-    RetainPtr<CFURLRequestRef> cfURLRequest = createCFURLRequestFromSerializableRepresentation(dictionary.get(), IPC::tokenNullTypeRef());
-    if (!cfURLRequest)
-        return false;
-
-    resourceRequest = ResourceRequest(cfURLRequest.get());
-#else
     RetainPtr<NSURLRequest> nsURLRequest = createNSURLRequestFromSerializableRepresentation(dictionary.get(), IPC::tokenNullTypeRef());
     if (!nsURLRequest)
         return false;
 
     resourceRequest = ResourceRequest(nsURLRequest.get());
-#endif
     
     Vector<String> responseContentDispositionEncodingFallbackArray;
     if (!decoder.decode(responseContentDispositionEncodingFallbackArray))

Modified: trunk/Source/WebKit/config.h (224827 => 224828)


--- trunk/Source/WebKit/config.h	2017-11-14 19:50:30 UTC (rev 224827)
+++ trunk/Source/WebKit/config.h	2017-11-14 19:54:01 UTC (rev 224828)
@@ -78,12 +78,6 @@
 #endif
 #endif
 
-#if USE(CFURLCONNECTION)
-#ifndef USE_NETWORK_SESSION
-#define USE_NETWORK_SESSION 0
-#endif
-#endif
-
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || PLATFORM(IOS) || PLATFORM(APPLETV) || PLATFORM(WATCHOS) || USE(SOUP)
 #ifndef USE_NETWORK_SESSION
 #define USE_NETWORK_SESSION 1
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to