diff --git a/Libraries/LibWeb/DOMURL/DOMURL.cpp b/Libraries/LibWeb/DOMURL/DOMURL.cpp index fd79e5f4be8..b815f321085 100644 --- a/Libraries/LibWeb/DOMURL/DOMURL.cpp +++ b/Libraries/LibWeb/DOMURL/DOMURL.cpp @@ -120,7 +120,7 @@ void DOMURL::visit_edges(Cell::Visitor& visitor) } // https://w3c.github.io/FileAPI/#dfn-createObjectURL -WebIDL::ExceptionOr DOMURL::create_object_url(JS::VM& vm, GC::Ref object) +WebIDL::ExceptionOr DOMURL::create_object_url(JS::VM& vm, GC::Ref object) { // The createObjectURL(obj) static method must return the result of adding an entry to the blob URL store for obj. return TRY_OR_THROW_OOM(vm, FileAPI::add_entry_to_blob_url_store(object)); diff --git a/Libraries/LibWeb/DOMURL/DOMURL.h b/Libraries/LibWeb/DOMURL/DOMURL.h index 5869263caac..b21128f8e6f 100644 --- a/Libraries/LibWeb/DOMURL/DOMURL.h +++ b/Libraries/LibWeb/DOMURL/DOMURL.h @@ -26,7 +26,7 @@ public: virtual ~DOMURL() override; - static WebIDL::ExceptionOr create_object_url(JS::VM&, GC::Ref object); + static WebIDL::ExceptionOr create_object_url(JS::VM&, GC::Ref object); static void revoke_object_url(JS::VM&, StringView url); static GC::Ptr parse_for_bindings(JS::VM&, String const& url, Optional const& base = {}); diff --git a/Libraries/LibWeb/DOMURL/DOMURL.idl b/Libraries/LibWeb/DOMURL/DOMURL.idl index cc468050b43..b7ed30dcfc5 100644 --- a/Libraries/LibWeb/DOMURL/DOMURL.idl +++ b/Libraries/LibWeb/DOMURL/DOMURL.idl @@ -24,6 +24,6 @@ interface URL { USVString toJSON(); - static DOMString createObjectURL(Blob obj); // FIXME: Should be (Blob or MediaSource). + static Utf16DOMString createObjectURL(Blob obj); // FIXME: Should be (Blob or MediaSource). static undefined revokeObjectURL(DOMString url); }; diff --git a/Libraries/LibWeb/FileAPI/BlobURLStore.cpp b/Libraries/LibWeb/FileAPI/BlobURLStore.cpp index 382a6b2519a..1362abb9641 100644 --- a/Libraries/LibWeb/FileAPI/BlobURLStore.cpp +++ b/Libraries/LibWeb/FileAPI/BlobURLStore.cpp @@ -25,10 +25,10 @@ BlobURLStore& blob_url_store() } // https://w3c.github.io/FileAPI/#unicodeBlobURL -ErrorOr generate_new_blob_url() +ErrorOr generate_new_blob_url() { // 1. Let result be the empty string. - StringBuilder result; + StringBuilder result { StringBuilder::Mode::UTF16 }; // 2. Append the string "blob:" to result. TRY(result.try_append("blob:"sv)); @@ -57,11 +57,11 @@ ErrorOr generate_new_blob_url() TRY(result.try_append(uuid)); // 10. Return result. - return result.to_string(); + return result.to_utf16_string(); } // https://w3c.github.io/FileAPI/#add-an-entry -ErrorOr add_entry_to_blob_url_store(GC::Ref object) +ErrorOr add_entry_to_blob_url_store(GC::Ref object) { // 1. Let store be the user agent’s blob URL store. auto& store = blob_url_store(); @@ -73,7 +73,7 @@ ErrorOr add_entry_to_blob_url_store(GC::Ref object) BlobURLEntry entry { object, HTML::current_principal_settings_object() }; // 4. Set store[url] to entry. - TRY(store.try_set(url, move(entry))); + TRY(store.try_set(url.to_utf8_but_should_be_ported_to_utf16(), move(entry))); // 5. Return url. return url; diff --git a/Libraries/LibWeb/FileAPI/BlobURLStore.h b/Libraries/LibWeb/FileAPI/BlobURLStore.h index 1b4c8176391..b709f214481 100644 --- a/Libraries/LibWeb/FileAPI/BlobURLStore.h +++ b/Libraries/LibWeb/FileAPI/BlobURLStore.h @@ -25,8 +25,8 @@ struct BlobURLEntry { using BlobURLStore = HashMap; BlobURLStore& blob_url_store(); -ErrorOr generate_new_blob_url(); -ErrorOr add_entry_to_blob_url_store(GC::Ref object); +ErrorOr generate_new_blob_url(); +ErrorOr add_entry_to_blob_url_store(GC::Ref object); bool check_for_same_partition_blob_url_usage(URL::BlobURLEntry const&, GC::Ref); struct NavigationEnvironment { }; Optional obtain_a_blob_object(URL::BlobURLEntry const&, Variant, NavigationEnvironment> environment);