Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e7be28da94629cd1f6d51d59561da29f830718b2
https://github.com/WebKit/WebKit/commit/e7be28da94629cd1f6d51d59561da29f830718b2
Author: Youenn Fablet <[email protected]>
Date: 2026-07-29 (Wed, 29 Jul 2026)
Changed paths:
M Source/WebCore/Modules/fetch/FormDataConsumer.cpp
M Source/WebCore/platform/network/PendingStreamState.cpp
M Source/WebCore/platform/network/PendingStreamState.h
M Source/WebCore/platform/network/cf/FormDataStreamCFNet.mm
M
Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp
M Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
Log Message:
-----------
Improve ability to get all chunks of PendingStreamState at once
rdar://183322787
https://bugs.webkit.org/show_bug.cgi?id=320362
Reviewed by Chris Dumez.
We were calling takeNextChunk in a while loop and everytime checking for error
or end of stream.
We can improve upon this by making a single takeAllChunks method, that will
return either the error, or the chunks and whether enf of stream or not.
We apply this and simplify the call sites.
We do the same for the other read method, that we rename readInto.
Covered by existing tests.
* Source/WebCore/Modules/fetch/FormDataConsumer.cpp:
(WebCore::FormDataConsumer::drainPendingStream):
* Source/WebCore/platform/network/PendingStreamState.cpp:
(WebCore::PendingStreamState::takeAvailableChunks):
(WebCore::PendingStreamState::takeNextChunk): Deleted.
(WebCore::PendingStreamState::readInto):
(WebCore::PendingStreamState::read): Deleted.
* Source/WebCore/platform/network/PendingStreamState.h:
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::pendingStreamDataAvailable):
* Source/WebKit/WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::initPendingStreamState):
* Source/WebCore/platform/network/cf/FormDataStreamCFNet.mm:
(WebCore::pendingStreamRead):
Canonical link: https://commits.webkit.org/318150@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications