Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Fetch API] Fetch response stream should enqueue Uint8Array
https://bugs.webkit.org/show_bug.cgi?id=160083 Patch by Youenn Fablet <youenn@apple.com> on 2016-07-23 Reviewed by Sam Weinig. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/resources/utils.js: Source/WebCore: Covered by updated tests. Before enqueuing, ReadableStreamController::enqueue will convert ArrayBuffer as Uint8Array. It also returns a boolean whether the operation is successful or not. If returned value is false, calling code will stop loading or if everything is loaded it will refrain from closing the stream. The enqueuing should be succesful except in OutOfMemory cases. This case is not yet handled in test cases. Updated the code to remove templated enqueuing as Fetch has no use of it. * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::consumeAsStream): Do not close the stream if enqueuing failed. * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::blobChunk): Stop blob loading if enqueuing failed. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::BodyLoader::didReceiveData): Stop resource loading if enqueuing failed. (WebCore::FetchResponse::consumeBodyAsStream): Ditto. * Modules/fetch/FetchResponseSource.h: * bindings/js/ReadableStreamController.h: (WebCore::ReadableStreamController::enqueue): (WebCore::ReadableStreamController::enqueue<RefPtr<JSC::ArrayBuffer>>): Deleted. Canonical link: https://commits.webkit.org/178268@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
69 additions
and 21 deletions.
- +9 −0 LayoutTests/imported/w3c/ChangeLog
- +1 −0 LayoutTests/imported/w3c/web-platform-tests/fetch/api/resources/utils.js
- +29 −0 Source/WebCore/ChangeLog
- +5 −5 Source/WebCore/Modules/fetch/FetchBody.cpp
- +3 −2 Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
- +5 −6 Source/WebCore/Modules/fetch/FetchResponse.cpp
- +5 −1 Source/WebCore/Modules/fetch/FetchResponseSource.h
- +12 −7 Source/WebCore/bindings/js/ReadableStreamController.h
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters