Commit graph

7 commits

Author SHA1 Message Date
Kenneth Myhra
c038a8c9c9 LibWeb: Make process_blob_parts() publicly accessible
This pulls process_blob_parts() out of the Blob class and makes it
publicly accessible.
2022-07-26 20:54:30 +01:00
Kenneth Myhra
622a4f29a7 LibWeb: Add public get accessor function for Blob's internal ByteBuffer
Blob::bytes() returns the ReadonlyBytes representation of our internal
ByteBuffer.

This change requires us to ByteBuffer::copy() Blob's ReadonlyBytes to a
ByteBuffer in XHR::send() and corresponding error handling of the copy
operation.

This removes the need for Blob to declare XMLHttpRequest as a friend
class.
2022-07-26 20:54:30 +01:00
Kenneth Myhra
9fe12c1851 LibWeb: Let get_buffer_source_copy() return ErrorOr instead of Optional
This is a minor refactor of IDL::get_buffer_source_copy() letting it
return ErrorOr<ByteBuffer> instead of Optional<ByteBuffer>.

This also updates all places that use IDL::get_buffer_source_copy().
2022-07-22 23:08:28 +01:00
Linus Groh
bc68539e26 LibWeb: Add & use TRY_OR_RETURN_OOM macro
This is a convenient way to return a DOM exception for operations that
return ErrorOr and only have an OOM failure path.
2022-07-17 21:08:10 +01:00
Linus Groh
ac36d272d3 LibWeb: Avoid needless copies during Blob construction 2022-07-17 00:34:25 +01:00
Kenneth Myhra
5806eeec08 LibWeb: Add support for XHR response type Blob 2022-07-17 00:23:19 +01:00
Kenneth Myhra
df8c49f6bf LibWeb: Introduce Blob 2022-07-17 00:23:19 +01:00