Remove dead networking code
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2018 17:55:55 +0000 (17:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2018 17:55:55 +0000 (17:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181813

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

CFURLConnection is only used on Windows.

* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData const):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/cf/ResourceError.h
Source/WebCore/platform/network/cf/ResourceRequest.h
Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp
Source/WebCore/platform/network/cf/ResourceResponse.h

index fca75f1..aab0bd2 100644 (file)
@@ -1,5 +1,26 @@
 2018-01-19  Alex Christensen  <achristensen@webkit.org>
 
+        Remove dead networking code
+        https://bugs.webkit.org/show_bug.cgi?id=181813
+
+        Reviewed by Tim Horton.
+
+        CFURLConnection is only used on Windows.
+
+        * platform/network/cf/ResourceError.h:
+        * platform/network/cf/ResourceRequest.h:
+        (WebCore::ResourceRequest::encodingRequiresPlatformData const):
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
+        (WebCore::ResourceRequest::doUpdatePlatformRequest):
+        (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
+        (WebCore::ResourceRequest::doUpdateResourceRequest):
+        (WebCore::ResourceRequest::setStorageSession):
+        * platform/network/cf/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+
+2018-01-19  Alex Christensen  <achristensen@webkit.org>
+
         Remove unused WebViewPrivate _allowCookies
         https://bugs.webkit.org/show_bug.cgi?id=181812
 
index e877cb0..b1b4846 100644 (file)
@@ -62,11 +62,9 @@ public:
     WEBCORE_EXPORT operator CFErrorRef() const;
 
 #if USE(CFURLCONNECTION)
-#if PLATFORM(WIN)
     ResourceError(const String& domain, int errorCode, const URL& failingURL, const String& localizedDescription, CFDataRef certificate);
     PCCERT_CONTEXT certificate() const;
     void setCertificate(CFDataRef);
-#endif
     ResourceError(CFStreamError error);
     CFStreamError cfStreamError() const;
     operator CFStreamError() const;
@@ -90,9 +88,6 @@ private:
     bool m_dataIsUpToDate;
 #if USE(CFURLCONNECTION)
     mutable RetainPtr<CFErrorRef> m_platformError;
-#if PLATFORM(COCOA)
-    mutable RetainPtr<NSError> m_platformNSError;
-#endif
 #if PLATFORM(WIN)
     RetainPtr<CFDataRef> m_certificate;
 #endif
index 14bcb6a..9fe9c78 100644 (file)
@@ -63,12 +63,6 @@ public:
     }
     
 #if USE(CFURLCONNECTION)
-#if PLATFORM(COCOA)
-    WEBCORE_EXPORT ResourceRequest(NSURLRequest *);
-    void updateNSURLRequest();
-    void clearOrUpdateNSURLRequest();
-#endif
-
     ResourceRequest(CFURLRequestRef cfRequest)
         : ResourceRequestBase()
         , m_cfRequest(cfRequest)
@@ -85,11 +79,7 @@ public:
     WEBCORE_EXPORT void updateFromDelegatePreservingOldProperties(const ResourceRequest&);
 
 #if PLATFORM(COCOA)
-#if USE(CFURLCONNECTION)
-    bool encodingRequiresPlatformData() const { return m_httpBody || m_cfRequest; }
-#else
     bool encodingRequiresPlatformData() const { return m_httpBody || m_nsRequest; }
-#endif
     WEBCORE_EXPORT NSURLRequest *nsURLRequest(HTTPBodyUpdatePolicy) const;
 
     WEBCORE_EXPORT static CFStringRef isUserInitiatedKey();
index 24df448..15618fb 100644 (file)
@@ -82,16 +82,6 @@ static CFURLRequestCopyContentDispositionEncodingFallbackArrayFunction findCFURL
 {
     return reinterpret_cast<CFURLRequestCopyContentDispositionEncodingFallbackArrayFunction>(GetProcAddress(findCFNetworkModule(), "_CFURLRequestCopyContentDispositionEncodingFallbackArray"));
 }
-#elif PLATFORM(COCOA)
-static CFURLRequestSetContentDispositionEncodingFallbackArrayFunction findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction()
-{
-    return reinterpret_cast<CFURLRequestSetContentDispositionEncodingFallbackArrayFunction>(dlsym(RTLD_DEFAULT, "_CFURLRequestSetContentDispositionEncodingFallbackArray"));
-}
-
-static CFURLRequestCopyContentDispositionEncodingFallbackArrayFunction findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction()
-{
-    return reinterpret_cast<CFURLRequestCopyContentDispositionEncodingFallbackArrayFunction>(dlsym(RTLD_DEFAULT, "_CFURLRequestCopyContentDispositionEncodingFallbackArray"));
-}
 #endif
 
 static void setContentDispositionEncodingFallbackArray(CFMutableURLRequestRef request, CFArrayRef fallbackArray)
@@ -175,10 +165,6 @@ void ResourceRequest::doUpdatePlatformRequest()
     if (resourcePrioritiesEnabled())
         CFURLRequestSetRequestPriority(cfRequest, toPlatformRequestPriority(priority()));
 
-#if !PLATFORM(WIN)
-    _CFURLRequestSetProtocolProperty(cfRequest, kCFURLRequestAllowAllPOSTCaching, kCFBooleanTrue);
-#endif
-
     setHeaderFields(cfRequest, httpHeaderFields());
 
     CFURLRequestSetShouldHandleHTTPCookies(cfRequest, allowCookies());
@@ -203,9 +189,6 @@ void ResourceRequest::doUpdatePlatformRequest()
 #endif
 
     m_cfRequest = adoptCF(cfRequest);
-#if PLATFORM(COCOA)
-    clearOrUpdateNSURLRequest();
-#endif
 }
 
 void ResourceRequest::doUpdatePlatformHTTPBody()
@@ -239,30 +222,12 @@ void ResourceRequest::doUpdatePlatformHTTPBody()
     }
 
     m_cfRequest = adoptCF(cfRequest);
-#if PLATFORM(COCOA)
-    clearOrUpdateNSURLRequest();
-#endif
 }
 
 void ResourceRequest::doUpdateResourceRequest()
 {
     if (!m_cfRequest) {
-#if PLATFORM(IOS)
-        // <rdar://problem/9913526>
-        // This is a hack to mimic the subtle behaviour of the Foundation based ResourceRequest
-        // code. That code does not reset m_httpMethod if the NSURLRequest is nil. I filed
-        // <https://bugs.webkit.org/show_bug.cgi?id=66336> to track that.
-        // Another related bug is <https://bugs.webkit.org/show_bug.cgi?id=66350>. Fixing that
-        // would, ideally, allow us to not have this hack. But unfortunately that caused layout test
-        // failures.
-        // Removal of this hack is tracked by <rdar://problem/9970499>.
-
-        String httpMethod = m_httpMethod;
         *this = ResourceRequest();
-        m_httpMethod = httpMethod;
-#else
-        *this = ResourceRequest();
-#endif
         return;
     }
 
@@ -338,9 +303,6 @@ void ResourceRequest::setStorageSession(CFURLStorageSessionRef storageSession)
     if (storageSession)
         _CFURLRequestSetStorageSession(cfRequest, storageSession);
     m_cfRequest = adoptCF(cfRequest);
-#if PLATFORM(COCOA)
-    clearOrUpdateNSURLRequest();
-#endif
 }
 
 #endif // USE(CFURLCONNECTION)
index 3129e55..a9f39f3 100644 (file)
@@ -50,9 +50,6 @@ public:
     {
         m_isNull = !cfResponse;
     }
-#if PLATFORM(COCOA)
-    WEBCORE_EXPORT ResourceResponse(NSURLResponse *);
-#endif
 #else
     ResourceResponse(NSURLResponse *nsResponse)
         : m_initLevel(Uninitialized)