Changeset 223752 in webkit
- Timestamp:
- Oct 20, 2017 2:22:54 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r223749 r223752 1 2017-10-20 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 3 [Curl] Clean up old style code in old curl files. 4 https://bugs.webkit.org/show_bug.cgi?id=178569 5 6 Reviewed by Ryosuke Niwa. 7 8 * platform/network/curl/AuthenticationChallenge.h: 9 * platform/network/curl/CertificateInfo.h: 10 * platform/network/curl/CookieJarCurl.h: 11 * platform/network/curl/CurlCacheEntry.h: 12 * platform/network/curl/CurlCacheManager.cpp: 13 (WebCore::CurlCacheManager::singleton): 14 (WebCore::CurlCacheManager::getInstance): Deleted. 15 * platform/network/curl/CurlCacheManager.h: 16 * platform/network/curl/CurlContext.cpp: 17 (WebCore::CurlContext::singleton): 18 * platform/network/curl/CurlContext.h: 19 (WebCore::CurlContext::singleton): Deleted. 20 * platform/network/curl/CurlJobManager.cpp: 21 (WebCore::CurlJobManager::singleton): 22 * platform/network/curl/CurlJobManager.h: 23 (WebCore::CurlJobManager::singleton): Deleted. 24 * platform/network/curl/CurlRequest.cpp: 25 (WebCore::CurlRequest::setupTransfer): 26 * platform/network/curl/CurlRequest.h: 27 * platform/network/curl/CurlRequestDelegate.h: 28 * platform/network/curl/CurlResponse.h: 29 (WebCore::CurlResponse::isolatedCopy const): 30 * platform/network/curl/CurlSSLHandle.h: 31 * platform/network/curl/CurlSSLVerifier.h: 32 * platform/network/curl/DownloadBundle.h: 33 * platform/network/curl/MultipartHandle.h: 34 * platform/network/curl/ResourceError.h: 35 * platform/network/curl/ResourceHandleCurlDelegate.cpp: 36 (WebCore::ResourceHandleCurlDelegate::createCurlRequest): 37 (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse): 38 (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer): 39 (WebCore::ResourceHandleCurlDelegate::curlDidComplete): 40 (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError): 41 * platform/network/curl/ResourceRequest.h: 42 (WebCore::ResourceRequest::ResourceRequest): 43 (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): 44 (WebCore::ResourceRequest::cfURLRequest const): 45 (WebCore::ResourceRequest::httpPipeliningEnabled): 46 (WebCore::ResourceRequest::setHTTPPipeliningEnabled): 47 (WebCore::ResourceRequest::doUpdatePlatformRequest): 48 (WebCore::ResourceRequest::doUpdateResourceRequest): 49 (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): 50 (WebCore::ResourceRequest::doUpdateResourceHTTPBody): 51 (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy): 52 * platform/network/curl/ResourceResponseCurl.cpp: 53 (WebCore::ResourceResponse::isAppendableHeader): 54 (WebCore::ResourceResponse::ResourceResponse): 55 1 56 2017-10-20 Frederic Wang <fwang@igalia.com> 2 57 -
trunk/Source/WebCore/platform/network/curl/AuthenticationChallenge.h
r222521 r223752 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 25 */ 26 #ifndef AuthenticationChallenge_h 27 # define AuthenticationChallenge_h26 27 #pragma once 28 28 29 29 #include "AuthenticationChallengeBase.h" … … 56 56 }; 57 57 58 } 59 60 #endif 58 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CertificateInfo.h
r181317 r223752 24 24 */ 25 25 26 #ifndef CertificateInfo_h 27 #define CertificateInfo_h 26 #pragma once 28 27 29 28 #include "NotImplemented.h" … … 38 37 }; 39 38 40 } 41 42 #endif 39 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CookieJarCurl.h
r223550 r223752 54 54 }; 55 55 56 } 56 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.h
r222113 r223752 25 25 */ 26 26 27 #ifndef CurlCacheEntry_h 28 #define CurlCacheEntry_h 27 #pragma once 29 28 30 29 #include "FileSystem.h" … … 98 97 }; 99 98 100 } 101 102 #endif // CurlCacheEntry_h 99 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp
r220939 r223752 38 38 #include "ResourceRequest.h" 39 39 #include <wtf/HashMap.h> 40 #include <wtf/NeverDestroyed.h> 40 41 #include <wtf/text/CString.h> 41 42 … … 44 45 namespace WebCore { 45 46 46 CurlCacheManager& CurlCacheManager:: getInstance()47 { 48 static CurlCacheManager instance;49 return instance;47 CurlCacheManager& CurlCacheManager::singleton() 48 { 49 static NeverDestroyed<CurlCacheManager> sharedInstance; 50 return sharedInstance; 50 51 } 51 52 -
trunk/Source/WebCore/platform/network/curl/CurlCacheManager.h
r177080 r223752 25 25 */ 26 26 27 #ifndef CurlCacheManager_h 28 #define CurlCacheManager_h 27 #pragma once 29 28 30 29 #include "CurlCacheEntry.h" … … 38 37 39 38 class CurlCacheManager { 40 39 friend NeverDestroyed<CurlCacheManager>; 41 40 public: 42 static CurlCacheManager& getInstance();41 static CurlCacheManager& singleton(); 43 42 44 43 void setCacheDirectory(const String&); … … 81 80 }; 82 81 83 } 84 85 #endif // CurlCacheManager_h 82 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlContext.cpp
r222828 r223752 32 32 #include <NetworkLoadMetrics.h> 33 33 #include <wtf/MainThread.h> 34 #include <wtf/NeverDestroyed.h> 34 35 #include <wtf/text/CString.h> 35 36 … … 40 41 #endif 41 42 42 using namespace WebCore;43 44 43 namespace WebCore { 45 44 … … 77 76 78 77 // CurlContext ------------------------------------------------------------------- 78 79 CurlContext& CurlContext::singleton() 80 { 81 static NeverDestroyed<CurlContext> sharedInstance; 82 return sharedInstance; 83 } 79 84 80 85 CurlContext::CurlContext() -
trunk/Source/WebCore/platform/network/curl/CurlContext.h
r222828 r223752 93 93 class CurlContext : public CurlGlobal { 94 94 WTF_MAKE_NONCOPYABLE(CurlContext); 95 95 friend NeverDestroyed<CurlContext>; 96 96 public: 97 97 struct ProxyInfo { … … 105 105 }; 106 106 107 static CurlContext& singleton() 108 { 109 static CurlContext shared; 110 return shared; 111 } 107 static CurlContext& singleton(); 112 108 113 109 virtual ~CurlContext(); … … 142 138 CurlContext(); 143 139 void initCookieSession(); 144 145 140 146 141 #ifndef NDEBUG … … 297 292 }; 298 293 299 } 294 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlJobManager.cpp
r222508 r223752 31 31 #if USE(CURL) 32 32 33 #include <wtf/NeverDestroyed.h> 34 33 35 namespace WebCore { 34 36 … … 77 79 HashMap<CURL*, CurlJobClient*> m_activeJobs; 78 80 }; 81 82 CurlJobManager& CurlJobManager::singleton() 83 { 84 static NeverDestroyed<CurlJobManager> sharedInstance; 85 return sharedInstance; 86 } 79 87 80 88 bool CurlJobManager::add(CurlJobClient* client) -
trunk/Source/WebCore/platform/network/curl/CurlJobManager.h
r222508 r223752 52 52 class CurlJobManager { 53 53 WTF_MAKE_NONCOPYABLE(CurlJobManager); 54 friend NeverDestroyed<CurlJobManager>; 54 55 public: 55 static CurlJobManager& singleton() 56 { 57 static CurlJobManager shared; 58 return shared; 59 } 56 static CurlJobManager& singleton(); 60 57 61 CurlJobManager() = default;62 58 ~CurlJobManager() { stopThread(); } 63 59 … … 68 64 69 65 private: 66 CurlJobManager() = default; 67 70 68 void startThreadIfNeeded(); 71 69 void stopThreadIfNoMoreJobRunning(); … … 85 83 }; 86 84 87 } 85 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp
r223681 r223752 153 153 m_curlHandle->appendRequestHeaders(m_request.httpHeaderFields()); 154 154 155 automethod = m_request.httpMethod();155 const auto& method = m_request.httpMethod(); 156 156 if (method == "GET") 157 157 m_curlHandle->enableHttpGetRequest(); -
trunk/Source/WebCore/platform/network/curl/CurlRequest.h
r223728 r223752 158 158 }; 159 159 160 } 160 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlRequestDelegate.h
r222665 r223752 42 42 }; 43 43 44 } 44 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlResponse.h
r222521 r223752 42 42 copy.expectedContentLength = expectedContentLength; 43 43 44 for ( autoheader : headers)44 for (const auto& header : headers) 45 45 copy.headers.append(header.isolatedCopy()); 46 46 … … 60 60 }; 61 61 62 } 62 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlSSLHandle.h
r222248 r223752 64 64 }; 65 65 66 67 } 66 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/CurlSSLVerifier.h
r222248 r223752 68 68 SSLCertificateFlags convertToSSLCertificateFlags(const unsigned&); 69 69 70 CurlHandle* m_curlHandle { nullptr};70 CurlHandle* m_curlHandle { }; 71 71 String m_hostName; 72 72 int m_sslErrors { 0 }; 73 73 }; 74 74 75 } 75 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/DownloadBundle.h
r222113 r223752 24 24 */ 25 25 26 #ifndef DownloadBundle_h 27 #define DownloadBundle_h 26 #pragma once 28 27 29 28 #include <wtf/Forward.h> … … 38 37 } // namespace DownloadBundle 39 38 } // namespace WebCore 40 41 #endif // DownloadBundle_h -
trunk/Source/WebCore/platform/network/curl/MultipartHandle.h
r223728 r223752 24 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 25 */ 26 #ifndef MultipartHandle_h 27 # define MultipartHandle_h26 27 #pragma once 28 28 29 29 #include "HTTPHeaderMap.h" … … 80 80 81 81 } // namespace WebCore 82 #endif // MultipartHandle_h -
trunk/Source/WebCore/platform/network/curl/ResourceError.h
r222187 r223752 62 62 }; 63 63 64 } 65 64 } // namespace WebCore -
trunk/Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp
r223408 r223752 157 157 bool hasCacheHeaders = request.httpHeaderFields().contains(HTTPHeaderName::IfModifiedSince) || request.httpHeaderFields().contains(HTTPHeaderName::IfNoneMatch); 158 158 if (!hasCacheHeaders) { 159 auto& cache = CurlCacheManager:: getInstance();159 auto& cache = CurlCacheManager::singleton(); 160 160 URL cacheUrl = request.url(); 161 161 cacheUrl.removeFragmentIdentifier(); … … 164 164 cache.addCacheEntryClient(cacheUrl, m_handle); 165 165 166 for ( autoentry : cache.requestHeaders(cacheUrl))166 for (const auto& entry : cache.requestHeaders(cacheUrl)) 167 167 request.addHTTPHeaderField(entry.key, entry.value); 168 168 … … 219 219 cacheUrl.removeFragmentIdentifier(); 220 220 221 if (CurlCacheManager:: getInstance().getCachedResponse(cacheUrl, response())) {221 if (CurlCacheManager::singleton().getCachedResponse(cacheUrl, response())) { 222 222 if (m_addedCacheValidationHeaders) { 223 223 response().setHTTPStatusCode(200); … … 227 227 } 228 228 229 CurlCacheManager:: getInstance().didReceiveResponse(*m_handle, response());229 CurlCacheManager::singleton().didReceiveResponse(*m_handle, response()); 230 230 231 231 auto protectedThis = makeRef(*m_handle); … … 244 244 m_multipartHandle->contentReceived(buffer->data(), buffer->size()); 245 245 else if (m_handle->client()) { 246 CurlCacheManager:: getInstance().didReceiveData(*m_handle, buffer->data(), buffer->size());246 CurlCacheManager::singleton().didReceiveData(*m_handle, buffer->data(), buffer->size()); 247 247 m_handle->client()->didReceiveBuffer(m_handle, WTFMove(buffer), buffer->size()); 248 248 } … … 263 263 264 264 if (m_handle->client()) { 265 CurlCacheManager:: getInstance().didFinishLoading(*m_handle);265 CurlCacheManager::singleton().didFinishLoading(*m_handle); 266 266 m_handle->client()->didFinishLoading(m_handle); 267 267 } … … 275 275 return; 276 276 277 CurlCacheManager:: getInstance().didFail(*m_handle);277 CurlCacheManager::singleton().didFail(*m_handle); 278 278 m_handle->client()->didFail(m_handle, resourceError); 279 279 } -
trunk/Source/WebCore/platform/network/curl/ResourceRequest.h
r201623 r223752 25 25 */ 26 26 27 #ifndef ResourceRequest_h 28 #define ResourceRequest_h 27 #pragma once 29 28 30 29 #include "ResourceRequestBase.h" … … 34 33 namespace WebCore { 35 34 36 37 38 39 40 41 35 class ResourceRequest : public ResourceRequestBase { 36 public: 37 ResourceRequest(const String& url) 38 : ResourceRequestBase(URL(ParsedURLString, url), UseProtocolCachePolicy) 39 { 40 } 42 41 43 44 45 46 42 ResourceRequest(const URL& url) 43 : ResourceRequestBase(url, UseProtocolCachePolicy) 44 { 45 } 47 46 48 49 50 51 52 47 ResourceRequest(const URL& url, const String& referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy) 48 : ResourceRequestBase(url, policy) 49 { 50 setHTTPReferrer(referrer); 51 } 53 52 54 55 56 57 53 ResourceRequest() 54 : ResourceRequestBase(URL(), UseProtocolCachePolicy) 55 { 56 } 58 57 59 60 61 62 58 ResourceRequest(CFURLRequestRef) 59 : ResourceRequestBase() 60 { 61 } 63 62 64 63 void updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest) { *this = delegateProvidedRequest; } 65 64 66 67 65 // Needed for compatibility. 66 CFURLRequestRef cfURLRequest(HTTPBodyUpdatePolicy) const { return 0; } 68 67 69 70 71 68 // The following two stubs are for compatibility with CFNetwork, and are not used. 69 static bool httpPipeliningEnabled() { return false; } 70 static void setHTTPPipeliningEnabled(bool) { } 72 71 73 74 72 private: 73 friend class ResourceRequestBase; 75 74 76 77 78 79 75 void doUpdatePlatformRequest() { } 76 void doUpdateResourceRequest() { } 77 void doUpdatePlatformHTTPBody() { } 78 void doUpdateResourceHTTPBody() { } 80 79 81 80 void doPlatformSetAsIsolatedCopy(const ResourceRequest&) { } 82 81 83 84 82 static bool s_httpPipeliningEnabled; 83 }; 85 84 86 85 } // namespace WebCore 87 88 #endif // ResourceRequest_h -
trunk/Source/WebCore/platform/network/curl/ResourceResponseCurl.cpp
r222756 r223752 69 69 return true; 70 70 71 for ( auto& header : appendableHeaders) {71 for (const auto& header : appendableHeaders) { 72 72 if (equalIgnoringASCIICase(key, header)) 73 73 return true; … … 82 82 setHTTPStatusCode(response.statusCode); 83 83 84 for ( autoheader : response.headers)84 for (const auto& header : response.headers) 85 85 appendHTTPHeaderField(header); 86 86 -
trunk/Source/WebKitLegacy/win/ChangeLog
r223720 r223752 1 2017-10-20 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 3 [Curl] Clean up old style code in old curl files. 4 https://bugs.webkit.org/show_bug.cgi?id=178569 5 6 Reviewed by Ryosuke Niwa. 7 8 * WebCache.cpp: 9 (WebCache::cacheFolder): 10 (WebCache::setCacheFolder): 11 * WebView.cpp: 12 (WebView::setCacheModel): 13 1 14 2017-10-19 Sam Weinig <sam@webkit.org> 2 15 -
trunk/Source/WebKitLegacy/win/WebCache.cpp
r207231 r223752 246 246 { 247 247 #if USE(CURL) 248 String cacheFolder = WebCore::CurlCacheManager:: getInstance().cacheDirectory();248 String cacheFolder = WebCore::CurlCacheManager::singleton().cacheDirectory(); 249 249 *location = WebCore::BString(cacheFolder).release(); 250 250 return S_OK; … … 262 262 #if USE(CURL) 263 263 String cacheFolder(location, SysStringLen(location)); 264 WebCore::CurlCacheManager:: getInstance().setCacheDirectory(cacheFolder);264 WebCore::CurlCacheManager::singleton().setCacheDirectory(cacheFolder); 265 265 return S_OK; 266 266 #elif USE(CFURLCONNECTION) -
trunk/Source/WebKitLegacy/win/WebView.cpp
r223720 r223752 514 514 CFIndex cacheDiskCapacity = 0; 515 515 #elif USE(CURL) 516 cacheDirectory = CurlCacheManager:: getInstance().cacheDirectory();516 cacheDirectory = CurlCacheManager::singleton().cacheDirectory(); 517 517 long cacheMemoryCapacity = 0; 518 518 long cacheDiskCapacity = 0; … … 685 685 CFURLCacheSetDiskCapacity(cfurlCache.get(), cacheDiskCapacity); 686 686 #elif USE(CURL) 687 CurlCacheManager:: getInstance().setStorageSizeLimit(cacheDiskCapacity);687 CurlCacheManager::singleton().setStorageSizeLimit(cacheDiskCapacity); 688 688 #endif 689 689
Note: See TracChangeset
for help on using the changeset viewer.