Commit graph

4 commits

Author SHA1 Message Date
Shannon Booth
97abc707c7 LibWeb/Bindings: Generate buffer typedefs as variants
Represent BufferSource and ArrayBufferView as ordinary IDL typedefs over
their underlying union types, instead of special casing in the IDL
generator. This allows the union conversion/return machinery handle
these types consistently with other typedefs, which removes buffer
specific paths from the IDL generator.

This necessitates changing the WebIDL::BufferSource and
WebIDL::ArrayBufferView classes as views over these variants. This
replaces the old GC backed BufferableObject wrapper structure and
provide convenience helpers to determine things such as the byte length,
byte offset, backing buffer, and typed-array APIs.
2026-05-30 11:22:08 +02:00
Andreas Kling
25b817db71 LibWeb: Avoid temporary stream chunks for fetch bytes
Teach readable byte stream enqueueing about native byte producers by
sharing the post-transfer part of the spec algorithm. This lets fetch
hand owned network bytes directly to the byte stream controller instead
of first wrapping them in an unobservable Uint8Array and then
transferring its buffer back into another ArrayBuffer.

Keep the public enqueue(chunk) path spec-shaped and make the native
path rejoin after the TransferArrayBuffer step, so observable chunks are
still created by the shared reader and queue handling code.

This reduces GC churn while playing YouTube videos.
2026-05-15 15:20:33 +02:00
Shannon Booth
fedbc1ec94 LibWeb/Streams: Convert UnderlyingSource to IDL bindings conversion 2026-05-09 10:49:49 +02:00
Timothy Flynn
a9ddd427cb LibWeb: Move ReadableStream AOs into their own file
The main streams AO file has gotten very large, and is a bit difficult
to navigate. In an effort to improve DX, this migrates ReadableStream
AOs to their own file. And the helper classes used for the tee and pipe-
to operations are also in their own files.
2025-04-18 06:55:40 -04:00