Cache API should return Abort error in case of putting an aborted fetch
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Apr 2019 22:12:03 +0000 (22:12 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Apr 2019 22:12:03 +0000 (22:12 +0000)
commit8d5047f3fc0e57e797ec3205ca91f763d2f28304
tree2760bb0bb9f6bb39e1c1aea568b8a6a1c96164f7
parent2f4fa30debb953bf4adc9b397522c2d5a1e5a900
Cache API should return Abort error in case of putting an aborted fetch
https://bugs.webkit.org/show_bug.cgi?id=196757

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt:

Source/WebCore:

In case of an aborted fetch, call consume callback with an AbortError.
Update the code that handles load cancelling as the loader callback is called.
Covered by rebased tests.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::addAbortSteps):
(WebCore::FetchResponse::BodyLoader::didFail):
(WebCore::FetchResponse::BodyLoader::BodyLoader):
(WebCore::FetchResponse::BodyLoader::~BodyLoader):
(WebCore::FetchResponse::stop):
* Modules/fetch/FetchResponse.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchResponse.cpp
Source/WebCore/Modules/fetch/FetchResponse.h