Update Fetch code to provide more useful exception messages
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2018 23:17:52 +0000 (23:17 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2018 23:17:52 +0000 (23:17 +0000)
commit662ee4874d4035ce95442a86c598a38a6c2aae66
tree908ccb1ed764cee5c0159b406fb4244e83304a18
parent59c3cc66054a40fb7de291c765e38f4a26f33adc
Update Fetch code to provide more useful exception messages
https://bugs.webkit.org/show_bug.cgi?id=186156

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline tests that have different output.

* web-platform-tests/fetch/api/headers/header-values-expected.txt:
* web-platform-tests/fetch/api/headers/header-values-normalize-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-network-error.https-expected.txt:

Source/WebCore:

Provide more useful error messages in our Loading / Fetch code.

* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader):
(WebCore::FetchHeaders::get const):
(WebCore::FetchHeaders::has const):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::setBody):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::clone):
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
* workers/service/context/ServiceWorkerFetch.h:

Source/WebKit:

Provide more useful error messages in our Loading / Fetch code.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::didFailFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFailFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
* WebProcess/Storage/ServiceWorkerClientFetch.h:
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
(WebKit::WebServiceWorkerFetchTaskClient::didFail):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:

LayoutTests:

Rebaseline tests that have different output.

* http/tests/workers/service/basic-fetch.https-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/basic-fetch.https-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/header-values-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/headers/header-values-normalize-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-network-error.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
Source/WebCore/Modules/fetch/FetchHeaders.cpp
Source/WebCore/Modules/fetch/FetchRequest.cpp
Source/WebCore/Modules/fetch/FetchResponse.cpp
Source/WebCore/workers/service/context/ServiceWorkerFetch.cpp
Source/WebCore/workers/service/context/ServiceWorkerFetch.h
Source/WebKit/ChangeLog
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
Source/WebKit/StorageProcess/StorageProcess.cpp
Source/WebKit/StorageProcess/StorageProcess.h
Source/WebKit/StorageProcess/StorageProcess.messages.in
Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp
Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h
Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.messages.in
Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp
Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h