LibURL+LibWeb+LibIPC: Represent blob URL entry's object using structs

Instead of just putting in members directly, wrap them up in structs
which represent what a URL blob entry is meant to hold per the spec.
This makes more obvious what this is meant to represent, such as the
ByteBuffer being used to represent the bytes behind a Blob.

This also allows us to use a stronger type for a function that needs
to return a Blob URL entry's object.
This commit is contained in:
Shannon Booth 2025-01-19 18:12:46 +13:00 committed by Tim Ledbetter
parent a0b0e91d4f
commit ca3d9d9ee0
Notes: github-actions[bot] 2025-01-21 19:23:20 +00:00
7 changed files with 29 additions and 16 deletions

View file

@ -826,7 +826,7 @@ WebIDL::ExceptionOr<GC::Ref<PendingResponse>> scheme_fetch(JS::Realm& realm, Inf
}
// 3. Let blob be blobURLEntrys object.
auto const blob = FileAPI::Blob::create(realm, blob_url_entry.value().byte_buffer, blob_url_entry.value().type);
auto const blob = FileAPI::Blob::create(realm, blob_url_entry.value().object.data, blob_url_entry.value().object.type);
// 4. Let response be a new response.
auto response = Infrastructure::Response::create(vm);