mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Use unbuffered network requests for all Fetch requests
Previously, unbuffered requests were only available as a special mode for EventSource. With this change, they are enabled by default, which means chunks can be read from the stream as soon as they arrive. This unlocks some interesting possibilities, such as starting to parse HTML documents before the entire response has been received (that, in turn, allows us to initiate subresource fetches earlier or begin executing scripts sooner), or start rendering videos before they are fully downloaded. Co-authored-by: Timothy Flynn <trflynn89@pm.me>
This commit is contained in:
parent
f942fef39b
commit
3058274386
Notes:
github-actions[bot]
2025-11-20 11:30:52 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 3058274386
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6839
Reviewed-by: https://github.com/trflynn89 ✅
4 changed files with 185 additions and 184 deletions
|
|
@ -544,8 +544,9 @@ void ResourceLoader::load_unbuffered(LoadRequest& request, GC::Root<OnHeadersRec
|
|||
}
|
||||
|
||||
if (!url.scheme().is_one_of("http"sv, "https"sv)) {
|
||||
// FIXME: Non-network requests from fetch should not go through this path.
|
||||
on_complete->function()(false, {}, "Cannot establish connection non-network scheme"sv);
|
||||
auto not_implemented_error = ByteString::formatted("Protocol not implemented: {}", url.scheme());
|
||||
log_failure(request, not_implemented_error);
|
||||
on_complete->function()(false, {}, not_implemented_error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue