diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp index bc41d26aeb..b1c94ddfbf 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp @@ -14,7 +14,7 @@ namespace Web::FileAPI { -DOM::ExceptionOr> Blob::create(HTML::Window& window, ByteBuffer byte_buffer, String type) +JS::NonnullGCPtr Blob::create(HTML::Window& window, ByteBuffer byte_buffer, String type) { return JS::NonnullGCPtr(*window.heap().allocate(window.realm(), window, move(byte_buffer), move(type))); } diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.h b/Userland/Libraries/LibWeb/FileAPI/Blob.h index b455cfbb61..d85bc94cb2 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.h +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.h @@ -33,8 +33,8 @@ class Blob : public Bindings::PlatformObject { public: virtual ~Blob() override; + static JS::NonnullGCPtr create(HTML::Window&, ByteBuffer, String type); static DOM::ExceptionOr> create(HTML::Window&, Optional> const& blob_parts = {}, Optional const& options = {}); - static DOM::ExceptionOr> create(HTML::Window&, ByteBuffer, String type); static DOM::ExceptionOr> create_with_global_object(HTML::Window&, Optional> const& blob_parts = {}, Optional const& options = {}); // https://w3c.github.io/FileAPI/#dfn-size diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 3cffd94dc3..97e3bd5cb6 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -132,7 +132,7 @@ DOM::ExceptionOr XMLHttpRequest::response() } // 6. Otherwise, if this’s response type is "blob", set this’s response object to a new Blob object representing this’s received bytes with type set to the result of get a final MIME type for this. else if (m_response_type == Bindings::XMLHttpRequestResponseType::Blob) { - auto blob_part = TRY(FileAPI::Blob::create(global_object(), m_received_bytes, get_final_mime_type().type())); + auto blob_part = FileAPI::Blob::create(global_object(), m_received_bytes, get_final_mime_type().type()); auto blob = TRY(FileAPI::Blob::create(global_object(), Vector { JS::make_handle(*blob_part) })); m_response_object = JS::Value(blob.ptr()); }