[Curl] Extract multipart handling from ResourceHandle to CurlRequest.
authordon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 21:36:28 +0000 (21:36 +0000)
committerdon.olmstead@sony.com <don.olmstead@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 21:36:28 +0000 (21:36 +0000)
commit8365dc67ee8e17f3c96692adc1c7d09a58fa50b1
tree53e695e08ba372612974e52c24be3c818acdb464
parent80c6a5ef42e39bdd429ef0d328de25348bbaec51
[Curl] Extract multipart handling from ResourceHandle to CurlRequest.
https://bugs.webkit.org/show_bug.cgi?id=181506

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-01-11
Reviewed by Alex Christensen.

Rename old MultipartHandle class to CurlMultipartHandle and modernize it. Also move the responsibility
of handling multi part from ResourceHandle to CurlRequest. This is required for upcoming NetworkLoadTask.

No new tests because no new behavior.

* platform/Curl.cmake:
* platform/network/curl/CurlMultipartHandle.cpp: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.cpp.
(WebCore::CurlMultipartHandle::createIfNeeded):
(WebCore::CurlMultipartHandle::extractBoundary):
(WebCore::CurlMultipartHandle::extractBoundaryFromContentType):
(WebCore::CurlMultipartHandle::CurlMultipartHandle):
(WebCore::CurlMultipartHandle::didReceiveData):
(WebCore::CurlMultipartHandle::didComplete):
(WebCore::CurlMultipartHandle::processContent):
(WebCore::CurlMultipartHandle::checkForBoundary):
(WebCore::CurlMultipartHandle::matchedLength):
(WebCore::CurlMultipartHandle::parseHeadersIfPossible):
* platform/network/curl/CurlMultipartHandle.h: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.h.
(WebCore::CurlMultipartHandle::~CurlMultipartHandle):
* platform/network/curl/CurlMultipartHandleClient.h: Added.
(WebCore::CurlMultipartHandleClient::~CurlMultipartHandleClient):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveHeaderFromMultipart):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::invokeDidReceiveResponse):
(WebCore::CurlRequest::completeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
(WebCore::ResourceHandleCurlDelegate::curlDidComplete):
* platform/network/curl/ResourceHandleCurlDelegate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/Curl.cmake
Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp [moved from Source/WebCore/platform/network/curl/MultipartHandle.cpp with 65% similarity]
Source/WebCore/platform/network/curl/CurlMultipartHandle.h [moved from Source/WebCore/platform/network/curl/MultipartHandle.h with 65% similarity]
Source/WebCore/platform/network/curl/CurlMultipartHandleClient.h [new file with mode: 0644]
Source/WebCore/platform/network/curl/CurlRequest.cpp
Source/WebCore/platform/network/curl/CurlRequest.h
Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.cpp
Source/WebCore/platform/network/curl/ResourceHandleCurlDelegate.h