[Curl] Clean up old style code in old curl files.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Oct 2017 09:22:54 +0000 (09:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Oct 2017 09:22:54 +0000 (09:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178569

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-20
Reviewed by Ryosuke Niwa.

Source/WebCore:

* platform/network/curl/AuthenticationChallenge.h:
* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CurlCacheEntry.h:
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::singleton):
(WebCore::CurlCacheManager::getInstance): Deleted.
* platform/network/curl/CurlCacheManager.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::singleton):
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::singleton): Deleted.
* platform/network/curl/CurlJobManager.cpp:
(WebCore::CurlJobManager::singleton):
* platform/network/curl/CurlJobManager.h:
(WebCore::CurlJobManager::singleton): Deleted.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlRequestDelegate.h:
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/CurlSSLHandle.h:
* platform/network/curl/CurlSSLVerifier.h:
* platform/network/curl/DownloadBundle.h:
* platform/network/curl/MultipartHandle.h:
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
(WebCore::ResourceHandleCurlDelegate::curlDidComplete):
(WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
(WebCore::ResourceRequest::cfURLRequest const):
(WebCore::ResourceRequest::httpPipeliningEnabled):
(WebCore::ResourceRequest::setHTTPPipeliningEnabled):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceHTTPBody):
(WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::isAppendableHeader):
(WebCore::ResourceResponse::ResourceResponse):

Source/WebKitLegacy/win:

* WebCache.cpp:
(WebCache::cacheFolder):
(WebCache::setCacheFolder):
* WebView.cpp:
(WebView::setCacheModel):

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

26 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/network/curl/AuthenticationChallenge.h
Source/WebCore/platform/network/curl/CertificateInfo.h
Source/WebCore/platform/network/curl/CookieJarCurl.h
Source/WebCore/platform/network/curl/CurlCacheEntry.h
Source/WebCore/platform/network/curl/CurlCacheManager.cpp
Source/WebCore/platform/network/curl/CurlCacheManager.h
Source/WebCore/platform/network/curl/CurlContext.cpp
Source/WebCore/platform/network/curl/CurlContext.h
Source/WebCore/platform/network/curl/CurlJobManager.cpp
Source/WebCore/platform/network/curl/CurlJobManager.h
Source/WebCore/platform/network/curl/CurlRequest.cpp
Source/WebCore/platform/network/curl/CurlRequest.h
Source/WebCore/platform/network/curl/CurlRequestDelegate.h
Source/WebCore/platform/network/curl/CurlResponse.h
Source/WebCore/platform/network/curl/CurlSSLHandle.h
Source/WebCore/platform/network/curl/CurlSSLVerifier.h
Source/WebCore/platform/network/curl/DownloadBundle.h
Source/WebCore/platform/network/curl/MultipartHandle.h
Source/WebCore/platform/network/curl/ResourceError.h
Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp
Source/WebCore/platform/network/curl/ResourceRequest.h
Source/WebCore/platform/network/curl/ResourceResponseCurl.cpp
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCache.cpp
Source/WebKitLegacy/win/WebView.cpp

index 5aacee9..83204cb 100644 (file)
@@ -1,3 +1,58 @@
+2017-10-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
+
+        [Curl] Clean up old style code in old curl files.
+        https://bugs.webkit.org/show_bug.cgi?id=178569
+
+        Reviewed by Ryosuke Niwa.
+
+        * platform/network/curl/AuthenticationChallenge.h:
+        * platform/network/curl/CertificateInfo.h:
+        * platform/network/curl/CookieJarCurl.h:
+        * platform/network/curl/CurlCacheEntry.h:
+        * platform/network/curl/CurlCacheManager.cpp:
+        (WebCore::CurlCacheManager::singleton):
+        (WebCore::CurlCacheManager::getInstance): Deleted.
+        * platform/network/curl/CurlCacheManager.h:
+        * platform/network/curl/CurlContext.cpp:
+        (WebCore::CurlContext::singleton):
+        * platform/network/curl/CurlContext.h:
+        (WebCore::CurlContext::singleton): Deleted.
+        * platform/network/curl/CurlJobManager.cpp:
+        (WebCore::CurlJobManager::singleton):
+        * platform/network/curl/CurlJobManager.h:
+        (WebCore::CurlJobManager::singleton): Deleted.
+        * platform/network/curl/CurlRequest.cpp:
+        (WebCore::CurlRequest::setupTransfer):
+        * platform/network/curl/CurlRequest.h:
+        * platform/network/curl/CurlRequestDelegate.h:
+        * platform/network/curl/CurlResponse.h:
+        (WebCore::CurlResponse::isolatedCopy const):
+        * platform/network/curl/CurlSSLHandle.h:
+        * platform/network/curl/CurlSSLVerifier.h:
+        * platform/network/curl/DownloadBundle.h:
+        * platform/network/curl/MultipartHandle.h:
+        * platform/network/curl/ResourceError.h:
+        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
+        (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
+        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
+        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
+        (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
+        (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
+        * platform/network/curl/ResourceRequest.h:
+        (WebCore::ResourceRequest::ResourceRequest):
+        (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
+        (WebCore::ResourceRequest::cfURLRequest const):
+        (WebCore::ResourceRequest::httpPipeliningEnabled):
+        (WebCore::ResourceRequest::setHTTPPipeliningEnabled):
+        (WebCore::ResourceRequest::doUpdatePlatformRequest):
+        (WebCore::ResourceRequest::doUpdateResourceRequest):
+        (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
+        (WebCore::ResourceRequest::doUpdateResourceHTTPBody):
+        (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
+        * platform/network/curl/ResourceResponseCurl.cpp:
+        (WebCore::ResourceResponse::isAppendableHeader):
+        (WebCore::ResourceResponse::ResourceResponse):
+
 2017-10-20  Frederic Wang  <fwang@igalia.com>
 
         RenderLayerCompositor: Move implementation of simple methods into the header file.
index ca86e3b..dccad8e 100644 (file)
@@ -23,8 +23,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
-#ifndef AuthenticationChallenge_h
-#define AuthenticationChallenge_h
+
+#pragma once
 
 #include "AuthenticationChallengeBase.h"
 #include "AuthenticationClient.h"
@@ -55,6 +55,4 @@ private:
     RefPtr<AuthenticationClient> m_authenticationClient;
 };
 
-}
-
-#endif
+} // namespace WebCore
index 0861830..798bf1e 100644 (file)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef CertificateInfo_h
-#define CertificateInfo_h
+#pragma once
 
 #include "NotImplemented.h"
 
@@ -37,6 +36,4 @@ public:
     bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; }
 };
 
-}
-
-#endif
+} // namespace WebCore
index 709147d..cbf181e 100644 (file)
@@ -53,4 +53,4 @@ class CookieJarCurlFileSystem : public CookieJarCurl {
     void deleteAllCookiesModifiedSince(const NetworkStorageSession&, std::chrono::system_clock::time_point) override;
 };
 
-}
+} // namespace WebCore
index 3b0b205..92d6bc3 100644 (file)
@@ -24,8 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef CurlCacheEntry_h
-#define CurlCacheEntry_h
+#pragma once
 
 #include "FileSystem.h"
 #include "HTTPHeaderMap.h"
@@ -97,6 +96,4 @@ private:
     bool closeContentFile();
 };
 
-}
-
-#endif // CurlCacheEntry_h
+} // namespace WebCore
index 31530f3..35bfe2e 100644 (file)
 #include "ResourceHandleInternal.h"
 #include "ResourceRequest.h"
 #include <wtf/HashMap.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
 #define IO_BUFFERSIZE 4096
 
 namespace WebCore {
 
-CurlCacheManager& CurlCacheManager::getInstance()
+CurlCacheManager& CurlCacheManager::singleton()
 {
-    static CurlCacheManager instance;
-    return instance;
+    static NeverDestroyed<CurlCacheManager> sharedInstance;
+    return sharedInstance;
 }
 
 CurlCacheManager::CurlCacheManager()
index f849871..4e249c9 100644 (file)
@@ -24,8 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef CurlCacheManager_h
-#define CurlCacheManager_h
+#pragma once
 
 #include "CurlCacheEntry.h"
 #include "ResourceHandle.h"
@@ -37,9 +36,9 @@
 namespace WebCore {
 
 class CurlCacheManager {
-
+    friend NeverDestroyed<CurlCacheManager>;
 public:
-    static CurlCacheManager& getInstance();
+    static CurlCacheManager& singleton();
 
     void setCacheDirectory(const String&);
     const String& cacheDirectory() { return m_cacheDir; }
@@ -80,6 +79,4 @@ private:
     void readCachedData(const String&, ResourceHandle*, ResourceResponse&);
 };
 
-}
-
-#endif // CurlCacheManager_h
+} // namespace WebCore
index 358bae7..45b30b1 100644 (file)
@@ -31,6 +31,7 @@
 #include "HTTPHeaderMap.h"
 #include <NetworkLoadMetrics.h>
 #include <wtf/MainThread.h>
+#include <wtf/NeverDestroyed.h>
 #include <wtf/text/CString.h>
 
 #if OS(WINDOWS)
@@ -39,8 +40,6 @@
 #include <shlwapi.h>
 #endif
 
-using namespace WebCore;
-
 namespace WebCore {
 
 static CString cookieJarPath()
@@ -77,6 +76,12 @@ static CString cookieJarPath()
 
 // CurlContext -------------------------------------------------------------------
 
+CurlContext& CurlContext::singleton()
+{
+    static NeverDestroyed<CurlContext> sharedInstance;
+    return sharedInstance;
+}
+
 CurlContext::CurlContext()
 : m_cookieJarFileName { cookieJarPath() }
 , m_cookieJar { std::make_unique<CookieJarCurlFileSystem>() }
index 9bcd3b7..92d3bac 100644 (file)
@@ -92,7 +92,7 @@ private:
 
 class CurlContext : public CurlGlobal {
     WTF_MAKE_NONCOPYABLE(CurlContext);
-
+    friend NeverDestroyed<CurlContext>;
 public:
     struct ProxyInfo {
         String host;
@@ -104,11 +104,7 @@ public:
         const String url() const;
     };
 
-    static CurlContext& singleton()
-    {
-        static CurlContext shared;
-        return shared;
-    }
+    static CurlContext& singleton();
 
     virtual ~CurlContext();
 
@@ -142,7 +138,6 @@ private:
     CurlContext();
     void initCookieSession();
 
-
 #ifndef NDEBUG
     FILE* m_logFile { nullptr };
     bool m_verbose { false };
@@ -296,4 +291,4 @@ private:
     CurlSList m_requestHeaders;
 };
 
-}
+} // namespace WebCore
index c72d657..75c6d11 100644 (file)
@@ -30,6 +30,8 @@
 
 #if USE(CURL)
 
+#include <wtf/NeverDestroyed.h>
+
 namespace WebCore {
 
 /*
@@ -77,6 +79,12 @@ private:
     HashMap<CURL*, CurlJobClient*> m_activeJobs;
 };
 
+CurlJobManager& CurlJobManager::singleton()
+{
+    static NeverDestroyed<CurlJobManager> sharedInstance;
+    return sharedInstance;
+}
+
 bool CurlJobManager::add(CurlJobClient* client)
 {
     ASSERT(isMainThread());
index 7a08c4e..b66f23b 100644 (file)
@@ -51,14 +51,10 @@ public:
 
 class CurlJobManager {
     WTF_MAKE_NONCOPYABLE(CurlJobManager);
+    friend NeverDestroyed<CurlJobManager>;
 public:
-    static CurlJobManager& singleton()
-    {
-        static CurlJobManager shared;
-        return shared;
-    }
+    static CurlJobManager& singleton();
 
-    CurlJobManager() = default;
     ~CurlJobManager() { stopThread(); }
 
     bool add(CurlJobClient*);
@@ -67,6 +63,8 @@ public:
     void callOnJobThread(WTF::Function<void()>&&);
 
 private:
+    CurlJobManager() = default;
+
     void startThreadIfNeeded();
     void stopThreadIfNoMoreJobRunning();
     void stopThread();
@@ -84,4 +82,4 @@ private:
     bool m_runThread { false };
 };
 
-}
+} // namespace WebCore
index 91ebd8d..4c2c187 100644 (file)
@@ -152,7 +152,7 @@ CURL* CurlRequest::setupTransfer()
     m_curlHandle->setUrl(m_request.url());
     m_curlHandle->appendRequestHeaders(m_request.httpHeaderFields());
 
-    auto method = m_request.httpMethod();
+    const auto& method = m_request.httpMethod();
     if (method == "GET")
         m_curlHandle->enableHttpGetRequest();
     else if (method == "POST")
index 55d07b2..40bc5e5 100644 (file)
@@ -157,4 +157,4 @@ private:
     NetworkLoadMetrics m_networkLoadMetrics;
 };
 
-}
+} // namespace WebCore
index 1b01e6c..f7f5bca 100644 (file)
@@ -41,4 +41,4 @@ public:
     virtual void curlDidFailWithError(const ResourceError&) = 0;
 };
 
-}
+} // namespace WebCore
index 095e68b..5028917 100644 (file)
@@ -41,7 +41,7 @@ public:
         copy.statusCode = statusCode;
         copy.expectedContentLength = expectedContentLength;
 
-        for (auto header : headers)
+        for (const auto& header : headers)
             copy.headers.append(header.isolatedCopy());
 
         copy.connectPort = connectPort;
@@ -59,4 +59,4 @@ public:
     long availableHttpAuth { 0 };
 };
 
-}
+} // namespace WebCore
index 6b3bf8d..853b456 100644 (file)
@@ -63,5 +63,4 @@ private:
     HashMap<String, ClientCertificate, ASCIICaseInsensitiveHash> m_allowedClientHosts;
 };
 
-
-}
+} // namespace WebCore
index 054b1b9..4b9530d 100644 (file)
@@ -67,9 +67,9 @@ private:
 
     SSLCertificateFlags convertToSSLCertificateFlags(const unsigned&);
 
-    CurlHandle* m_curlHandle { nullptr };
+    CurlHandle* m_curlHandle { };
     String m_hostName;
     int m_sslErrors { 0 };
 };
 
-}
+} // namespace WebCore
index 8de2245..c125deb 100644 (file)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef DownloadBundle_h
-#define DownloadBundle_h
+#pragma once
 
 #include <wtf/Forward.h>
 
@@ -37,5 +36,3 @@ const String& fileExtension();
 
 } // namespace DownloadBundle
 } // namespace WebCore
-
-#endif // DownloadBundle_h
index f85d1b7..f7ed746 100644 (file)
@@ -23,8 +23,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-#ifndef MultipartHandle_h
-#define MultipartHandle_h
+
+#pragma once
 
 #include "HTTPHeaderMap.h"
 #include "ResourceHandle.h"
@@ -79,4 +79,3 @@ private:
 };
 
 } // namespace WebCore
-#endif // MultipartHandle_h
index 500ed5b..8b85773 100644 (file)
@@ -156,14 +156,14 @@ Ref<CurlRequest> ResourceHandleCurlDelegate::createCurlRequest(ResourceRequest&
 
     bool hasCacheHeaders = request.httpHeaderFields().contains(HTTPHeaderName::IfModifiedSince) || request.httpHeaderFields().contains(HTTPHeaderName::IfNoneMatch);
     if (!hasCacheHeaders) {
-        auto& cache = CurlCacheManager::getInstance();
+        auto& cache = CurlCacheManager::singleton();
         URL cacheUrl = request.url();
         cacheUrl.removeFragmentIdentifier();
 
         if (cache.isCached(cacheUrl)) {
             cache.addCacheEntryClient(cacheUrl, m_handle);
 
-            for (auto entry : cache.requestHeaders(cacheUrl))
+            for (const auto& entry : cache.requestHeaders(cacheUrl))
                 request.addHTTPHeaderField(entry.key, entry.value);
 
             m_addedCacheValidationHeaders = true;
@@ -218,7 +218,7 @@ void ResourceHandleCurlDelegate::curlDidReceiveResponse(const CurlResponse& rece
             URL cacheUrl = m_currentRequest.url();
             cacheUrl.removeFragmentIdentifier();
 
-            if (CurlCacheManager::getInstance().getCachedResponse(cacheUrl, response())) {
+            if (CurlCacheManager::singleton().getCachedResponse(cacheUrl, response())) {
                 if (m_addedCacheValidationHeaders) {
                     response().setHTTPStatusCode(200);
                     response().setHTTPStatusText("OK");
@@ -226,7 +226,7 @@ void ResourceHandleCurlDelegate::curlDidReceiveResponse(const CurlResponse& rece
             }
         }
 
-        CurlCacheManager::getInstance().didReceiveResponse(*m_handle, response());
+        CurlCacheManager::singleton().didReceiveResponse(*m_handle, response());
 
         auto protectedThis = makeRef(*m_handle);
         m_handle->didReceiveResponse(ResourceResponse(response()));
@@ -243,7 +243,7 @@ void ResourceHandleCurlDelegate::curlDidReceiveBuffer(Ref<SharedBuffer>&& buffer
     if (m_multipartHandle)
         m_multipartHandle->contentReceived(buffer->data(), buffer->size());
     else if (m_handle->client()) {
-        CurlCacheManager::getInstance().didReceiveData(*m_handle, buffer->data(), buffer->size());
+        CurlCacheManager::singleton().didReceiveData(*m_handle, buffer->data(), buffer->size());
         m_handle->client()->didReceiveBuffer(m_handle, WTFMove(buffer), buffer->size());
     }
 }
@@ -262,7 +262,7 @@ void ResourceHandleCurlDelegate::curlDidComplete()
         m_multipartHandle->contentEnded();
 
     if (m_handle->client()) {
-        CurlCacheManager::getInstance().didFinishLoading(*m_handle);
+        CurlCacheManager::singleton().didFinishLoading(*m_handle);
         m_handle->client()->didFinishLoading(m_handle);
     }
 }
@@ -274,7 +274,7 @@ void ResourceHandleCurlDelegate::curlDidFailWithError(const ResourceError& resou
     if (cancelledOrClientless())
         return;
 
-    CurlCacheManager::getInstance().didFail(*m_handle);
+    CurlCacheManager::singleton().didFail(*m_handle);
     m_handle->client()->didFail(m_handle, resourceError);
 }
 
index 7dbf64d..1bc3ff0 100644 (file)
@@ -24,8 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef ResourceRequest_h
-#define ResourceRequest_h
+#pragma once
 
 #include "ResourceRequestBase.h"
 
@@ -33,56 +32,54 @@ typedef const struct _CFURLRequest* CFURLRequestRef;
 
 namespace WebCore {
 
-    class ResourceRequest : public ResourceRequestBase {
-    public:
-        ResourceRequest(const String& url)
-            : ResourceRequestBase(URL(ParsedURLString, url), UseProtocolCachePolicy)
-        {
-        }
+class ResourceRequest : public ResourceRequestBase {
+public:
+    ResourceRequest(const String& url)
+        : ResourceRequestBase(URL(ParsedURLString, url), UseProtocolCachePolicy)
+    {
+    }
 
-        ResourceRequest(const URL& url)
-            : ResourceRequestBase(url, UseProtocolCachePolicy)
-        {
-        }
+    ResourceRequest(const URL& url)
+        : ResourceRequestBase(url, UseProtocolCachePolicy)
+    {
+    }
 
-        ResourceRequest(const URL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy)
-            : ResourceRequestBase(url, policy)
-        {
-            setHTTPReferrer(referrer);
-        }
+    ResourceRequest(const URL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy)
+        : ResourceRequestBase(url, policy)
+    {
+        setHTTPReferrer(referrer);
+    }
 
-        ResourceRequest()
-            : ResourceRequestBase(URL(), UseProtocolCachePolicy)
-        {
-        }
+    ResourceRequest()
+        : ResourceRequestBase(URL(), UseProtocolCachePolicy)
+    {
+    }
 
-        ResourceRequest(CFURLRequestRef)
-            : ResourceRequestBase()
-        {
-        }
+    ResourceRequest(CFURLRequestRef)
+        : ResourceRequestBase()
+    {
+    }
 
-        void updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest) { *this = delegateProvidedRequest; }
+    void updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest) { *this = delegateProvidedRequest; }
 
-        // Needed for compatibility.
-        CFURLRequestRef cfURLRequest(HTTPBodyUpdatePolicy) const { return 0; }
+    // Needed for compatibility.
+    CFURLRequestRef cfURLRequest(HTTPBodyUpdatePolicy) const { return 0; }
 
-        // The following two stubs are for compatibility with CFNetwork, and are not used.
-        static bool httpPipeliningEnabled() { return false; }
-        static void setHTTPPipeliningEnabled(bool) { }
+    // The following two stubs are for compatibility with CFNetwork, and are not used.
+    static bool httpPipeliningEnabled() { return false; }
+    static void setHTTPPipeliningEnabled(bool) { }
 
-    private:
-        friend class ResourceRequestBase;
+private:
+    friend class ResourceRequestBase;
 
-        void doUpdatePlatformRequest() { }
-        void doUpdateResourceRequest() { }
-        void doUpdatePlatformHTTPBody() { }
-        void doUpdateResourceHTTPBody() { }
+    void doUpdatePlatformRequest() { }
+    void doUpdateResourceRequest() { }
+    void doUpdatePlatformHTTPBody() { }
+    void doUpdateResourceHTTPBody() { }
 
-        void doPlatformSetAsIsolatedCopy(const ResourceRequest&) { }
+    void doPlatformSetAsIsolatedCopy(const ResourceRequest&) { }
 
-        static bool s_httpPipeliningEnabled;
-    };
+    static bool s_httpPipeliningEnabled;
+};
 
 } // namespace WebCore
-
-#endif // ResourceRequest_h
index 081974d..1480c84 100644 (file)
@@ -68,7 +68,7 @@ bool ResourceResponse::isAppendableHeader(const String &key)
     if (key.startsWith("x-", /* caseSensitive */ false))
         return true;
 
-    for (auto& header : appendableHeaders) {
+    for (const auto& header : appendableHeaders) {
         if (equalIgnoringASCIICase(key, header))
             return true;
     }
@@ -81,7 +81,7 @@ ResourceResponse::ResourceResponse(const CurlResponse& response)
 {
     setHTTPStatusCode(response.statusCode);
 
-    for (auto header : response.headers)
+    for (const auto& header : response.headers)
         appendHTTPHeaderField(header);
 
     setMimeType(extractMIMETypeFromMediaType(httpHeaderField(HTTPHeaderName::ContentType)).convertToASCIILowercase());
index ccbbe74..18c1cf7 100644 (file)
@@ -1,3 +1,16 @@
+2017-10-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>
+
+        [Curl] Clean up old style code in old curl files.
+        https://bugs.webkit.org/show_bug.cgi?id=178569
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebCache.cpp:
+        (WebCache::cacheFolder):
+        (WebCache::setCacheFolder):
+        * WebView.cpp:
+        (WebView::setCacheModel):
+
 2017-10-19  Sam Weinig  <sam@webkit.org>
 
         [Settings] Move global settings into their own file
index 591afa5..75632df 100644 (file)
@@ -245,7 +245,7 @@ HRESULT WebCache::disabled(_Out_ BOOL* disabled)
 HRESULT WebCache::cacheFolder(__deref_out_opt BSTR* location)
 {
 #if USE(CURL)
-    String cacheFolder = WebCore::CurlCacheManager::getInstance().cacheDirectory();
+    String cacheFolder = WebCore::CurlCacheManager::singleton().cacheDirectory();
     *location = WebCore::BString(cacheFolder).release();
     return S_OK;
 #elif USE(CFURLCONNECTION)
@@ -261,7 +261,7 @@ HRESULT WebCache::setCacheFolder(_In_ BSTR location)
 {
 #if USE(CURL)
     String cacheFolder(location, SysStringLen(location));
-    WebCore::CurlCacheManager::getInstance().setCacheDirectory(cacheFolder);
+    WebCore::CurlCacheManager::singleton().setCacheDirectory(cacheFolder);
     return S_OK;
 #elif USE(CFURLCONNECTION)
     RetainPtr<CFURLCacheRef> cache = adoptCF(CFURLCacheCopySharedURLCache());
index 4fce9c6..f7af76f 100644 (file)
@@ -513,7 +513,7 @@ void WebView::setCacheModel(WebCacheModel cacheModel)
     CFIndex cacheMemoryCapacity = 0;
     CFIndex cacheDiskCapacity = 0;
 #elif USE(CURL)
-    cacheDirectory = CurlCacheManager::getInstance().cacheDirectory();
+    cacheDirectory = CurlCacheManager::singleton().cacheDirectory();
     long cacheMemoryCapacity = 0;
     long cacheDiskCapacity = 0;
 #endif
@@ -684,7 +684,7 @@ void WebView::setCacheModel(WebCacheModel cacheModel)
     CFURLCacheSetMemoryCapacity(cfurlCache.get(), cacheMemoryCapacity);
     CFURLCacheSetDiskCapacity(cfurlCache.get(), cacheDiskCapacity);
 #elif USE(CURL)
-    CurlCacheManager::getInstance().setStorageSizeLimit(cacheDiskCapacity);
+    CurlCacheManager::singleton().setStorageSizeLimit(cacheDiskCapacity);
 #endif
 
     s_didSetCacheModel = true;