diff --git a/Userland/Libraries/LibIPC/Decoder.cpp b/Userland/Libraries/LibIPC/Decoder.cpp index 1eee8c0275a..0d5c6bc0b94 100644 --- a/Userland/Libraries/LibIPC/Decoder.cpp +++ b/Userland/Libraries/LibIPC/Decoder.cpp @@ -91,6 +91,7 @@ ErrorOr decode(Decoder& decoder) url.set_blob_url_entry(URL::BlobURLEntry { .type = TRY(decoder.decode()), .byte_buffer = TRY(decoder.decode()), + .environment_origin = TRY(decoder.decode()), }); return url; diff --git a/Userland/Libraries/LibIPC/Encoder.cpp b/Userland/Libraries/LibIPC/Encoder.cpp index fee330495dc..a01a58cf9b2 100644 --- a/Userland/Libraries/LibIPC/Encoder.cpp +++ b/Userland/Libraries/LibIPC/Encoder.cpp @@ -111,6 +111,7 @@ ErrorOr encode(Encoder& encoder, URL::URL const& value) TRY(encoder.encode(blob.type)); TRY(encoder.encode(blob.byte_buffer)); + TRY(encoder.encode(blob.environment_origin)); return {}; } diff --git a/Userland/Libraries/LibURL/URL.h b/Userland/Libraries/LibURL/URL.h index 6774ba678ee..463f0837ea1 100644 --- a/Userland/Libraries/LibURL/URL.h +++ b/Userland/Libraries/LibURL/URL.h @@ -14,6 +14,7 @@ #include #include #include +#include // On Linux distros that use mlibc `basename` is defined as a macro that expands to `__mlibc_gnu_basename` or `__mlibc_gnu_basename_c`, so we undefine it. #if defined(AK_OS_LINUX) && defined(basename) @@ -44,6 +45,7 @@ enum class ExcludeFragment { struct BlobURLEntry { String type; ByteBuffer byte_buffer; + Origin environment_origin; }; void append_percent_encoded_if_necessary(StringBuilder&, u32 code_point, PercentEncodeSet set = PercentEncodeSet::Userinfo); diff --git a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp index 911f232a325..d126cc63264 100644 --- a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp @@ -489,8 +489,8 @@ URL::Origin url_origin(URL::URL const& url) auto url_string = url.to_string().release_value_but_fixme_should_propagate_errors(); // 1. If url’s blob URL entry is non-null, then return url’s blob URL entry’s environment’s origin. - if (auto blob_url_entry = FileAPI::blob_url_store().get(url_string); blob_url_entry.has_value()) - return blob_url_entry->environment->origin(); + if (url.blob_url_entry().has_value()) + return url.blob_url_entry()->environment_origin; // 2. Let pathURL be the result of parsing the result of URL path serializing url. auto path_url = parse(url.serialize_path()); @@ -582,6 +582,7 @@ URL::URL parse(StringView input, Optional const& base_url, Optionalobject->type(), .byte_buffer = MUST(ByteBuffer::copy(blob_url_entry->object->raw_bytes())), + .environment_origin = blob_url_entry->environment->origin(), }); }