Changeset 244515 in webkit
- Timestamp:
- Apr 22, 2019 3:12:03 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r244460 r244515 1 2019-04-22 Youenn Fablet <youenn@apple.com> 2 3 Cache API should return Abort error in case of putting an aborted fetch 4 https://bugs.webkit.org/show_bug.cgi?id=196757 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt: 9 * web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt: 10 * web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt: 11 1 12 2019-04-19 Antoine Quint <graouts@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-abort.https-expected.txt
r244094 r244515 3 3 PASS put() on an already-aborted request should reject with AbortError 4 4 PASS put() synchronously followed by abort should reject with AbortError 5 FAIL put() followed by abort after headers received should reject with AbortError assert_throws: put should reject function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 5 PASS put() followed by abort after headers received should reject with AbortError 6 6 PASS add() on an already-aborted request should reject with AbortError 7 7 PASS add() synchronously followed by abort should reject with AbortError 8 FAIL add() followed by abort after headers received should reject with AbortError assert_throws: add should reject function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 8 PASS add() followed by abort after headers received should reject with AbortError 9 9 PASS addAll() on an already-aborted request should reject with AbortError 10 10 PASS addAll() synchronously followed by abort should reject with AbortError 11 FAIL addAll() followed by abort after headers received should reject with AbortError assert_throws: addAll should reject function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 11 PASS addAll() followed by abort after headers received should reject with AbortError 12 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/window/cache-abort.https-expected.txt
r244094 r244515 2 2 PASS put() on an already-aborted request should reject with AbortError 3 3 PASS put() synchronously followed by abort should reject with AbortError 4 FAIL put() followed by abort after headers received should reject with AbortError assert_throws: put should reject function "function () { throw e }" threw object "TypeError: Load cancelled" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 4 PASS put() followed by abort after headers received should reject with AbortError 5 5 PASS add() on an already-aborted request should reject with AbortError 6 6 PASS add() synchronously followed by abort should reject with AbortError 7 FAIL add() followed by abort after headers received should reject with AbortError assert_throws: add should reject function "function () { throw e }" threw object "TypeError: Load cancelled" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 7 PASS add() followed by abort after headers received should reject with AbortError 8 8 PASS addAll() on an already-aborted request should reject with AbortError 9 9 PASS addAll() synchronously followed by abort should reject with AbortError 10 FAIL addAll() followed by abort after headers received should reject with AbortError assert_throws: addAll should reject function "function () { throw e }" threw object "TypeError: Load cancelled" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 10 PASS addAll() followed by abort after headers received should reject with AbortError 11 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/cache-storage/worker/cache-abort.https-expected.txt
r244094 r244515 2 2 PASS put() on an already-aborted request should reject with AbortError 3 3 PASS put() synchronously followed by abort should reject with AbortError 4 FAIL put() followed by abort after headers received should reject with AbortError assert_throws: put should reject function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 4 PASS put() followed by abort after headers received should reject with AbortError 5 5 PASS add() on an already-aborted request should reject with AbortError 6 6 PASS add() synchronously followed by abort should reject with AbortError 7 FAIL add() followed by abort after headers received should reject with AbortError assert_throws: add should reject function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 7 PASS add() followed by abort after headers received should reject with AbortError 8 8 PASS addAll() on an already-aborted request should reject with AbortError 9 9 PASS addAll() synchronously followed by abort should reject with AbortError 10 FAIL addAll() followed by abort after headers received should reject with AbortError assert_throws: addAll should reject function "function () { throw e }" threw object "TypeError: Type error" that is not a DOMException AbortError: property "code" is equal to undefined, expected 20 10 PASS addAll() followed by abort after headers received should reject with AbortError 11 11 -
trunk/Source/WebCore/ChangeLog
r244511 r244515 1 2019-04-22 Youenn Fablet <youenn@apple.com> 2 3 Cache API should return Abort error in case of putting an aborted fetch 4 https://bugs.webkit.org/show_bug.cgi?id=196757 5 6 Reviewed by Darin Adler. 7 8 In case of an aborted fetch, call consume callback with an AbortError. 9 Update the code that handles load cancelling as the loader callback is called. 10 Covered by rebased tests. 11 12 * Modules/fetch/FetchResponse.cpp: 13 (WebCore::FetchResponse::addAbortSteps): 14 (WebCore::FetchResponse::BodyLoader::didFail): 15 (WebCore::FetchResponse::BodyLoader::BodyLoader): 16 (WebCore::FetchResponse::BodyLoader::~BodyLoader): 17 (WebCore::FetchResponse::stop): 18 * Modules/fetch/FetchResponse.h: 19 1 20 2019-04-22 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp
r243163 r244515 202 202 if (auto callback = m_bodyLoader->takeNotificationCallback()) 203 203 callback(Exception { AbortError, "Fetch is aborted"_s }); 204 205 if (auto callback = m_bodyLoader->takeConsumeDataCallback()) 206 callback(Exception { AbortError, "Fetch is aborted"_s }); 204 207 } 205 208 … … 212 215 m_body->loadingFailed(*loadingException()); 213 216 214 if (m_bodyLoader) { 215 m_bodyLoader->stop(); 216 m_bodyLoader = WTF::nullopt; 217 } 217 if (auto bodyLoader = WTFMove(m_bodyLoader)) 218 bodyLoader->stop(); 218 219 }); 219 220 } … … 305 306 306 307 // Check whether didFail is called as part of FetchLoader::start. 307 if (m_loader ->isStarted()) {308 if (m_loader && m_loader->isStarted()) { 308 309 Ref<FetchResponse> protector(m_response); 309 310 m_response.m_bodyLoader = WTF::nullopt; … … 314 315 : m_response(response) 315 316 , m_responseCallback(WTFMove(responseCallback)) 316 { 317 m_response.setPendingActivity(m_response); 317 , m_pendingActivity(m_response.makePendingActivity(m_response)) 318 { 318 319 } 319 320 320 321 FetchResponse::BodyLoader::~BodyLoader() 321 322 { 322 m_response.unsetPendingActivity(m_response);323 323 } 324 324 … … 522 522 RefPtr<FetchResponse> protectedThis(this); 523 523 FetchBodyOwner::stop(); 524 if (m_bodyLoader) { 525 m_bodyLoader->stop(); 526 m_bodyLoader = WTF::nullopt; 527 } 524 if (auto bodyLoader = WTFMove(m_bodyLoader)) 525 bodyLoader->stop(); 528 526 } 529 527 -
trunk/Source/WebCore/Modules/fetch/FetchResponse.h
r239644 r244515 130 130 public: 131 131 BodyLoader(FetchResponse&, NotificationCallback&&); 132 BodyLoader(BodyLoader&&) = default; 132 133 ~BodyLoader(); 133 134 … … 141 142 #endif 142 143 NotificationCallback takeNotificationCallback() { return WTFMove(m_responseCallback); } 144 ConsumeDataByChunkCallback takeConsumeDataCallback() { return WTFMove(m_consumeDataCallback); } 143 145 144 146 private: … … 153 155 ConsumeDataByChunkCallback m_consumeDataCallback; 154 156 std::unique_ptr<FetchLoader> m_loader; 157 Ref<PendingActivity<FetchResponse>> m_pendingActivity; 155 158 }; 156 159
Note: See TracChangeset
for help on using the changeset viewer.