LibWeb: Remove exception handling from safely extracting response bodies

The entire purpose of this AO is to avoid handling exceptions, which we
can do now that the underlying AOs do not throw exceptions on OOM.
This commit is contained in:
Timothy Flynn 2024-11-04 16:06:01 +01:00 committed by Andrew Kaster
commit 953fe75271
Notes: github-actions[bot] 2024-12-10 03:04:18 +00:00
8 changed files with 33 additions and 34 deletions

View file

@ -134,10 +134,10 @@ void Body::incrementally_read_loop(Streams::ReadableStreamDefaultReader& reader,
}
// https://fetch.spec.whatwg.org/#byte-sequence-as-a-body
WebIDL::ExceptionOr<GC::Ref<Body>> byte_sequence_as_body(JS::Realm& realm, ReadonlyBytes bytes)
GC::Ref<Body> byte_sequence_as_body(JS::Realm& realm, ReadonlyBytes bytes)
{
// To get a byte sequence bytes as a body, return the body of the result of safely extracting bytes.
auto [body, _] = TRY(safely_extract_body(realm, bytes));
auto [body, _] = safely_extract_body(realm, bytes);
return body;
}

View file

@ -76,6 +76,6 @@ struct BodyWithType {
Optional<ByteBuffer> type;
};
WebIDL::ExceptionOr<GC::Ref<Body>> byte_sequence_as_body(JS::Realm&, ReadonlyBytes);
GC::Ref<Body> byte_sequence_as_body(JS::Realm&, ReadonlyBytes);
}