Move URL from WebCore to WTF
[WebKit-https.git] / Source / WebKit / NetworkProcess / CustomProtocols / Cocoa / LegacyCustomProtocolManagerCocoa.mm
index 646e0e2..6e9028d 100644 (file)
 #import "LegacyCustomProtocolManagerMessages.h"
 #import "NetworkProcess.h"
 #import <Foundation/NSURLSession.h>
-#import <WebCore/NSURLConnectionSPI.h>
 #import <WebCore/ResourceError.h>
 #import <WebCore/ResourceRequest.h>
 #import <WebCore/ResourceResponse.h>
 #import <WebCore/TextEncoding.h>
-#import <WebCore/URL.h>
+#import <pal/spi/cocoa/NSURLConnectionSPI.h>
+#import <wtf/URL.h>
 
 using namespace WebKit;
 
@@ -107,17 +107,12 @@ namespace WebKit {
 
 void LegacyCustomProtocolManager::registerProtocolClass()
 {
-#if !USE(NETWORK_SESSION)
-    [NSURLProtocol registerClass:[WKCustomProtocol class]];
-#endif
 }
 
-#if USE(NETWORK_SESSION)
 void LegacyCustomProtocolManager::registerProtocolClass(NSURLSessionConfiguration *configuration)
 {
     configuration.protocolClasses = @[[WKCustomProtocol class]];
 }
-#endif
 
 void LegacyCustomProtocolManager::registerScheme(const String& scheme)
 {
@@ -209,7 +204,7 @@ void LegacyCustomProtocolManager::wasRedirectedToRequest(uint64_t customProtocol
     if (!protocol)
         return;
 
-    RetainPtr<NSURLRequest> nsRequest = request.nsURLRequest(WebCore::DoNotUpdateHTTPBody);
+    RetainPtr<NSURLRequest> nsRequest = request.nsURLRequest(WebCore::HTTPBodyUpdatePolicy::DoNotUpdateHTTPBody);
     RetainPtr<NSURLResponse> nsRedirectResponse = redirectResponse.nsURLResponse();
 
     dispatchOnInitializationRunLoop(protocol.get(), [protocol, nsRequest, nsRedirectResponse]() {