mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 17:35:08 +00:00
LibWeb: Make Fetch::Infrastructure::Body
be GC allocated
Making the body GC-allocated allows us to avoid using `JS::Handle` for `m_stream` in its members.
This commit is contained in:
parent
953c19bdb7
commit
bdd3a16b16
21 changed files with 117 additions and 91 deletions
|
@ -165,7 +165,7 @@ void abort_fetch(JS::Realm& realm, WebIDL::Promise const& promise, JS::NonnullGC
|
|||
WebIDL::reject_promise(realm, promise, error);
|
||||
|
||||
// 2. If request’s body is non-null and is readable, then cancel request’s body with error.
|
||||
if (auto* body = request->body().get_pointer<Infrastructure::Body>(); body != nullptr && body->stream()->is_readable()) {
|
||||
if (auto* body = request->body().get_pointer<JS::NonnullGCPtr<Infrastructure::Body>>(); body != nullptr && (*body)->stream()->is_readable()) {
|
||||
// TODO: Implement cancelling streams
|
||||
(void)error;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ void abort_fetch(JS::Realm& realm, WebIDL::Promise const& promise, JS::NonnullGC
|
|||
auto response = response_object->response();
|
||||
|
||||
// 5. If response’s body is non-null and is readable, then error response’s body with error.
|
||||
if (response->body().has_value()) {
|
||||
if (response->body()) {
|
||||
auto stream = response->body()->stream();
|
||||
if (stream->is_readable()) {
|
||||
// TODO: Implement erroring streams
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue