From bf29eb2a89a5cd7f18b5aa5cb32811335dd2533b Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Thu, 28 May 2026 22:25:26 +0200 Subject: [PATCH] LibWeb: Remove various case of unneeded use of GC::Root --- Libraries/LibWeb/Geometry/DOMMatrix.cpp | 4 ++-- Libraries/LibWeb/Geometry/DOMMatrix.h | 4 ++-- Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp | 4 ++-- Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h | 4 ++-- Libraries/LibWeb/HTML/ElementInternals.cpp | 4 ++-- Libraries/LibWeb/HTML/FormControlInfrastructure.cpp | 2 +- Libraries/LibWeb/HTML/HTMLFormElement.cpp | 2 +- .../LibWeb/MediaSourceExtensions/SourceBuffer.cpp | 2 +- .../LibWeb/MediaSourceExtensions/SourceBuffer.h | 2 +- Libraries/LibWeb/ServiceWorker/Cache.cpp | 8 ++++---- Libraries/LibWeb/WebAudio/AnalyserNode.cpp | 8 ++++---- Libraries/LibWeb/WebAudio/AnalyserNode.h | 8 ++++---- Libraries/LibWeb/WebAudio/AudioBuffer.cpp | 4 ++-- Libraries/LibWeb/WebAudio/AudioBuffer.h | 4 ++-- Libraries/LibWeb/WebAudio/BaseAudioContext.cpp | 4 ++-- Libraries/LibWeb/WebAudio/BaseAudioContext.h | 4 ++-- Libraries/LibWeb/WebAudio/BiquadFilterNode.cpp | 2 +- Libraries/LibWeb/WebAudio/BiquadFilterNode.h | 2 +- Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp | 12 ++++++------ Libraries/LibWeb/XHR/FormDataIterator.cpp | 4 ++-- 20 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Libraries/LibWeb/Geometry/DOMMatrix.cpp b/Libraries/LibWeb/Geometry/DOMMatrix.cpp index 2ccd6b9b5f..ce60599e4f 100644 --- a/Libraries/LibWeb/Geometry/DOMMatrix.cpp +++ b/Libraries/LibWeb/Geometry/DOMMatrix.cpp @@ -159,7 +159,7 @@ WebIDL::ExceptionOr> DOMMatrix::from_matrix(JS::VM& vm, Bindi } // https://drafts.fxtf.org/geometry/#dom-dommatrix-fromfloat32array -WebIDL::ExceptionOr> DOMMatrix::from_float32_array(JS::VM& vm, GC::Root const& array) +WebIDL::ExceptionOr> DOMMatrix::from_float32_array(JS::VM& vm, GC::Ref array) { auto& realm = *vm.current_realm(); ReadonlySpan elements = array->data(); @@ -180,7 +180,7 @@ WebIDL::ExceptionOr> DOMMatrix::from_float32_array(JS::VM& vm } // https://drafts.fxtf.org/geometry/#dom-dommatrix-fromfloat64array -WebIDL::ExceptionOr> DOMMatrix::from_float64_array(JS::VM& vm, GC::Root const& array) +WebIDL::ExceptionOr> DOMMatrix::from_float64_array(JS::VM& vm, GC::Ref array) { auto& realm = *vm.current_realm(); ReadonlySpan elements = array->data(); diff --git a/Libraries/LibWeb/Geometry/DOMMatrix.h b/Libraries/LibWeb/Geometry/DOMMatrix.h index 50604a767a..bc56fde40e 100644 --- a/Libraries/LibWeb/Geometry/DOMMatrix.h +++ b/Libraries/LibWeb/Geometry/DOMMatrix.h @@ -29,8 +29,8 @@ public: virtual ~DOMMatrix() override; static WebIDL::ExceptionOr> from_matrix(JS::VM&, Bindings::DOMMatrixInit other = {}); - static WebIDL::ExceptionOr> from_float32_array(JS::VM&, GC::Root const&); - static WebIDL::ExceptionOr> from_float64_array(JS::VM&, GC::Root const&); + static WebIDL::ExceptionOr> from_float32_array(JS::VM&, GC::Ref); + static WebIDL::ExceptionOr> from_float64_array(JS::VM&, GC::Ref); void set_m11(double value); void set_m12(double value); diff --git a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp index bcbc72a636..a69f7e240d 100644 --- a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp +++ b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp @@ -230,7 +230,7 @@ WebIDL::ExceptionOr> DOMMatrixReadOnly::from_matrix(J } // https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-fromfloat32array -WebIDL::ExceptionOr> DOMMatrixReadOnly::from_float32_array(JS::VM& vm, GC::Root const& array) +WebIDL::ExceptionOr> DOMMatrixReadOnly::from_float32_array(JS::VM& vm, GC::Ref array) { auto& realm = *vm.current_realm(); ReadonlySpan elements = array->data(); @@ -251,7 +251,7 @@ WebIDL::ExceptionOr> DOMMatrixReadOnly::from_float32_ } // https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-fromfloat64array -WebIDL::ExceptionOr> DOMMatrixReadOnly::from_float64_array(JS::VM& vm, GC::Root const& array) +WebIDL::ExceptionOr> DOMMatrixReadOnly::from_float64_array(JS::VM& vm, GC::Ref array) { auto& realm = *vm.current_realm(); ReadonlySpan elements = array->data(); diff --git a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h index e2ac2ed4d9..74525d14f7 100644 --- a/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h +++ b/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.h @@ -34,8 +34,8 @@ public: virtual ~DOMMatrixReadOnly() override; static WebIDL::ExceptionOr> from_matrix(JS::VM&, Bindings::DOMMatrixInit& other); - static WebIDL::ExceptionOr> from_float32_array(JS::VM&, GC::Root const&); - static WebIDL::ExceptionOr> from_float64_array(JS::VM&, GC::Root const&); + static WebIDL::ExceptionOr> from_float32_array(JS::VM&, GC::Ref); + static WebIDL::ExceptionOr> from_float64_array(JS::VM&, GC::Ref); // https://drafts.fxtf.org/geometry/#dommatrix-attributes double m11() const { return m_matrix[0, 0]; } diff --git a/Libraries/LibWeb/HTML/ElementInternals.cpp b/Libraries/LibWeb/HTML/ElementInternals.cpp index 641c608eab..ed29935660 100644 --- a/Libraries/LibWeb/HTML/ElementInternals.cpp +++ b/Libraries/LibWeb/HTML/ElementInternals.cpp @@ -84,13 +84,13 @@ WebIDL::ExceptionOr ElementInternals::set_form_value(ElementInternalsFormV // 6. Otherwise, set element's state to state. else { auto state_value = state.value().visit( - [](GC::Root const& file) -> FormAssociatedElement::FACESubmissionValue { + [](GC::Ref file) -> FormAssociatedElement::FACESubmissionValue { return GC::Ref { *file }; }, [](String const& string) -> FormAssociatedElement::FACESubmissionValue { return string; }, - [](GC::Root const& form_data) -> FormAssociatedElement::FACESubmissionValue { + [](GC::Ref form_data) -> FormAssociatedElement::FACESubmissionValue { return form_data->entry_list(); }, [](Empty const& empty) -> FormAssociatedElement::FACESubmissionValue { diff --git a/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp b/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp index 8114867618..c84bea15f1 100644 --- a/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp +++ b/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp @@ -316,7 +316,7 @@ ErrorOr serialize_to_multipart_form_data(GC::ConservativeVec auto escaped_name = TRY(escape_line_feed_carriage_return_double_quote(normalized_name)); TRY(entry.value.visit( - [&](GC::Root const& file) -> ErrorOr { + [&](GC::Ref file) -> ErrorOr { // For filenames replace any 0x0A (LF) bytes with the byte sequence `%0A`, 0x0D (CR) with `%0D` and 0x22 (") with `%22` auto escaped_filename = TRY(escape_line_feed_carriage_return_double_quote(file->name())); // Add a `Content-Disposition` header with a `name` set to entry's name and `filename` set to entry's filename. diff --git a/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 8bb6b41f4a..2160f2dc4a 100644 --- a/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -754,7 +754,7 @@ static ErrorOr> convert_to_list_of_name_value_pairs(G // 2. If entry's value is a File object, then let value be entry's value's name. Otherwise, let value be entry's value. String value; entry.value.visit( - [&value](GC::Root const& file) { + [&value](GC::Ref file) { value = file->name(); }, [&value](String const& string) { diff --git a/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.cpp b/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.cpp index 8c3b5144ae..891b36fddc 100644 --- a/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.cpp +++ b/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.cpp @@ -324,7 +324,7 @@ WebIDL::ExceptionOr SourceBuffer::prepare_append(size_t new_data_size, AK: } // https://w3c.github.io/media-source/#dom-sourcebuffer-appendbuffer -WebIDL::ExceptionOr SourceBuffer::append_buffer(GC::Root const& data) +WebIDL::ExceptionOr SourceBuffer::append_buffer(GC::Ref data) { // 1. Run the prepare append algorithm. TRY(prepare_append(data->byte_length(), m_media_source->media_element_assigned_to()->playback_manager().current_time())); diff --git a/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.h b/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.h index ceba110b96..bbded29125 100644 --- a/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.h +++ b/Libraries/LibWeb/MediaSourceExtensions/SourceBuffer.h @@ -50,7 +50,7 @@ public: void set_content_type(String const& type); // https://w3c.github.io/media-source/#addsourcebuffer-method - WebIDL::ExceptionOr append_buffer(GC::Root const&); + WebIDL::ExceptionOr append_buffer(GC::Ref); // https://w3c.github.io/media-source/#dom-sourcebuffer-abort WebIDL::ExceptionOr abort(); diff --git a/Libraries/LibWeb/ServiceWorker/Cache.cpp b/Libraries/LibWeb/ServiceWorker/Cache.cpp index 1ad548ad56..889a7fcb8f 100644 --- a/Libraries/LibWeb/ServiceWorker/Cache.cpp +++ b/Libraries/LibWeb/ServiceWorker/Cache.cpp @@ -104,7 +104,7 @@ GC::Ref Cache::match_all(Optional request, if (request.has_value()) { TRY(request->visit( // 1. If request is a Request object, then: - [&](GC::Root const& request) -> ErrorOr> { + [&](GC::Ref request) -> ErrorOr> { // 1. Set r to request’s request. inner_request = request->request(); @@ -415,7 +415,7 @@ GC::Ref Cache::put(Fetch::RequestInfo request, GC::Ref const& request) -> ErrorOr> { + [&](GC::Ref request) -> ErrorOr> { inner_request = request->request(); return {}; }, @@ -545,7 +545,7 @@ GC::Ref Cache::delete_(Fetch::RequestInfo request, Bindings::Ca TRY(request.visit( // 2. If request is a Request object, then: - [&](GC::Root const& request) -> ErrorOr> { + [&](GC::Ref request) -> ErrorOr> { // 1. Set r to request’s request. inner_request = request->request(); @@ -633,7 +633,7 @@ GC::Ref Cache::keys(Optional request, Bindi if (request.has_value()) { TRY(request->visit( // 1. If request is a Request object, then: - [&](GC::Root const& request) -> ErrorOr> { + [&](GC::Ref request) -> ErrorOr> { // 1. Set r to request’s request. inner_request = request->request(); diff --git a/Libraries/LibWeb/WebAudio/AnalyserNode.cpp b/Libraries/LibWeb/WebAudio/AnalyserNode.cpp index 47a32c408b..e8eb70cee3 100644 --- a/Libraries/LibWeb/WebAudio/AnalyserNode.cpp +++ b/Libraries/LibWeb/WebAudio/AnalyserNode.cpp @@ -135,7 +135,7 @@ Vector AnalyserNode::current_frequency_data() } // https://webaudio.github.io/web-audio-api/#dom-analysernode-getfloatfrequencydata -WebIDL::ExceptionOr AnalyserNode::get_float_frequency_data(GC::Root const& array) +WebIDL::ExceptionOr AnalyserNode::get_float_frequency_data(GC::Ref array) { // Write the current frequency data into array. If array has fewer elements than the frequencyBinCount, // the excess elements will be dropped. If array has more elements than the frequencyBinCount, the @@ -156,7 +156,7 @@ WebIDL::ExceptionOr AnalyserNode::get_float_frequency_data(GC::Root AnalyserNode::get_byte_frequency_data(GC::Root const& array) +WebIDL::ExceptionOr AnalyserNode::get_byte_frequency_data(GC::Ref array) { // FIXME: If another call to getByteFrequencyData() or getFloatFrequencyData() occurs within the same render // quantum as a previous call, the current frequency data is not updated with the same data. Instead, @@ -198,7 +198,7 @@ WebIDL::ExceptionOr AnalyserNode::get_byte_frequency_data(GC::Root AnalyserNode::get_float_time_domain_data(GC::Root const& array) +WebIDL::ExceptionOr AnalyserNode::get_float_time_domain_data(GC::Ref array) { // Write the current time-domain data (waveform data) into array. If array has fewer elements than the // value of fftSize, the excess elements will be dropped. If array has more elements than the value of @@ -216,7 +216,7 @@ WebIDL::ExceptionOr AnalyserNode::get_float_time_domain_data(GC::Root AnalyserNode::get_byte_time_domain_data(GC::Root const& array) +WebIDL::ExceptionOr AnalyserNode::get_byte_time_domain_data(GC::Ref array) { // Write the current time-domain data (waveform data) into array. If array’s byte length is less than // fftSize, the excess elements will be dropped. If array’s byte length is greater than the fftSize, diff --git a/Libraries/LibWeb/WebAudio/AnalyserNode.h b/Libraries/LibWeb/WebAudio/AnalyserNode.h index 89bade8820..498c1df3a2 100644 --- a/Libraries/LibWeb/WebAudio/AnalyserNode.h +++ b/Libraries/LibWeb/WebAudio/AnalyserNode.h @@ -26,10 +26,10 @@ public: virtual WebIDL::UnsignedLong number_of_inputs() override { return 1; } virtual WebIDL::UnsignedLong number_of_outputs() override { return 1; } - WebIDL::ExceptionOr get_float_frequency_data(GC::Root const&); - WebIDL::ExceptionOr get_byte_frequency_data(GC::Root const&); - WebIDL::ExceptionOr get_float_time_domain_data(GC::Root const&); - WebIDL::ExceptionOr get_byte_time_domain_data(GC::Root const&); + WebIDL::ExceptionOr get_float_frequency_data(GC::Ref); + WebIDL::ExceptionOr get_byte_frequency_data(GC::Ref); + WebIDL::ExceptionOr get_float_time_domain_data(GC::Ref); + WebIDL::ExceptionOr get_byte_time_domain_data(GC::Ref); unsigned long fft_size() const { return m_fft_size; } unsigned long frequency_bin_count() const { return m_fft_size / 2; } diff --git a/Libraries/LibWeb/WebAudio/AudioBuffer.cpp b/Libraries/LibWeb/WebAudio/AudioBuffer.cpp index c9c7c25800..1b46749d2b 100644 --- a/Libraries/LibWeb/WebAudio/AudioBuffer.cpp +++ b/Libraries/LibWeb/WebAudio/AudioBuffer.cpp @@ -87,7 +87,7 @@ WebIDL::ExceptionOr> AudioBuffer::get_channel_data(Web } // https://webaudio.github.io/web-audio-api/#dom-audiobuffer-copyfromchannel -WebIDL::ExceptionOr AudioBuffer::copy_from_channel(GC::Root const& destination, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset) const +WebIDL::ExceptionOr AudioBuffer::copy_from_channel(GC::Ref destination, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset) const { // The copyFromChannel() method copies the samples from the specified channel of the AudioBuffer to the destination array. // @@ -113,7 +113,7 @@ WebIDL::ExceptionOr AudioBuffer::copy_from_channel(GC::Root AudioBuffer::copy_to_channel(GC::Root const& source, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset) +WebIDL::ExceptionOr AudioBuffer::copy_to_channel(GC::Ref source, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset) { // The copyToChannel() method copies the samples to the specified channel of the AudioBuffer from the source array. // diff --git a/Libraries/LibWeb/WebAudio/AudioBuffer.h b/Libraries/LibWeb/WebAudio/AudioBuffer.h index c5a1888abc..ba3b992ae9 100644 --- a/Libraries/LibWeb/WebAudio/AudioBuffer.h +++ b/Libraries/LibWeb/WebAudio/AudioBuffer.h @@ -31,8 +31,8 @@ public: double duration() const; WebIDL::UnsignedLong number_of_channels() const; WebIDL::ExceptionOr> get_channel_data(WebIDL::UnsignedLong channel) const; - WebIDL::ExceptionOr copy_from_channel(GC::Root const&, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset = 0) const; - WebIDL::ExceptionOr copy_to_channel(GC::Root const&, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset = 0); + WebIDL::ExceptionOr copy_from_channel(GC::Ref, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset = 0) const; + WebIDL::ExceptionOr copy_to_channel(GC::Ref, WebIDL::UnsignedLong channel_number, WebIDL::UnsignedLong buffer_offset = 0); private: explicit AudioBuffer(JS::Realm&, Bindings::AudioBufferOptions const&); diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp index 8aeb08161c..debf232322 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp @@ -227,7 +227,7 @@ void BaseAudioContext::queue_control_message(ControlMessage message) } // https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata -GC::Ref BaseAudioContext::decode_audio_data(GC::Root const& audio_data, GC::Ptr success_callback, GC::Ptr error_callback) +GC::Ref BaseAudioContext::decode_audio_data(GC::Ref audio_data, GC::Ptr success_callback, GC::Ptr error_callback) { auto& realm = this->realm(); @@ -281,7 +281,7 @@ GC::Ref BaseAudioContext::decode_audio_data(GC::Root promise, [[maybe_unused]] GC::Root audio_data, GC::Ptr success_callback, GC::Ptr error_callback) +void BaseAudioContext::queue_a_decoding_operation(GC::Ref promise, [[maybe_unused]] GC::Ref audio_data, GC::Ptr success_callback, GC::Ptr error_callback) { auto& realm = this->realm(); diff --git a/Libraries/LibWeb/WebAudio/BaseAudioContext.h b/Libraries/LibWeb/WebAudio/BaseAudioContext.h index d49ef433f6..bba3565df5 100644 --- a/Libraries/LibWeb/WebAudio/BaseAudioContext.h +++ b/Libraries/LibWeb/WebAudio/BaseAudioContext.h @@ -89,7 +89,7 @@ public: WebIDL::UnsignedLong number_of_output_channels); WebIDL::ExceptionOr> create_stereo_panner(); - GC::Ref decode_audio_data(GC::Root const&, GC::Ptr, GC::Ptr); + GC::Ref decode_audio_data(GC::Ref, GC::Ptr, GC::Ptr); void queue_control_message(ControlMessage); @@ -110,7 +110,7 @@ private: // https://webaudio.github.io/web-audio-api/#render-quantum-size static constexpr WebIDL::UnsignedLong s_render_quantum_size { 128 }; - void queue_a_decoding_operation(GC::Ref, GC::Root, GC::Ptr, GC::Ptr); + void queue_a_decoding_operation(GC::Ref, GC::Ref, GC::Ptr, GC::Ptr); u64 m_next_node_id { 0 }; diff --git a/Libraries/LibWeb/WebAudio/BiquadFilterNode.cpp b/Libraries/LibWeb/WebAudio/BiquadFilterNode.cpp index 6401772944..ebba9f9d73 100644 --- a/Libraries/LibWeb/WebAudio/BiquadFilterNode.cpp +++ b/Libraries/LibWeb/WebAudio/BiquadFilterNode.cpp @@ -66,7 +66,7 @@ GC::Ref BiquadFilterNode::gain() const } // https://webaudio.github.io/web-audio-api/#dom-biquadfilternode-getfrequencyresponse -WebIDL::ExceptionOr BiquadFilterNode::get_frequency_response(GC::Root const& frequency_hz, GC::Root const& mag_response, GC::Root const& phase_response) +WebIDL::ExceptionOr BiquadFilterNode::get_frequency_response(GC::Ref frequency_hz, GC::Ref mag_response, GC::Ref phase_response) { (void)frequency_hz; (void)mag_response; diff --git a/Libraries/LibWeb/WebAudio/BiquadFilterNode.h b/Libraries/LibWeb/WebAudio/BiquadFilterNode.h index ad02ebf925..0820bf5900 100644 --- a/Libraries/LibWeb/WebAudio/BiquadFilterNode.h +++ b/Libraries/LibWeb/WebAudio/BiquadFilterNode.h @@ -29,7 +29,7 @@ public: GC::Ref detune() const; GC::Ref q() const; GC::Ref gain() const; - WebIDL::ExceptionOr get_frequency_response(GC::Root const&, GC::Root const&, GC::Root const&); + WebIDL::ExceptionOr get_frequency_response(GC::Ref, GC::Ref, GC::Ref); static WebIDL::ExceptionOr> create(JS::Realm&, GC::Ref, Bindings::BiquadFilterOptions const& = {}); static WebIDL::ExceptionOr> construct_impl(JS::Realm&, GC::Ref, Bindings::BiquadFilterOptions const& = {}); diff --git a/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp b/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp index a5c938b57f..6835bb1ef2 100644 --- a/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp +++ b/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp @@ -266,25 +266,25 @@ Optional WebGLRenderingContextBase::read_and_pixel_conv // a SECURITY_ERR exception must be thrown. See Origin Restrictions. // FIXME: If source is null then an INVALID_VALUE error is generated. auto frame = source.visit( - [](GC::Root const& source) -> Optional { + [](GC::Ref source) -> Optional { return source->current_image_frame(); }, - [](GC::Root const& source) -> Optional { + [](GC::Ref source) -> Optional { auto surface = source->surface(); if (!surface) return Gfx::DecodedImageFrame { *source->get_bitmap_from_surface() }; return Gfx::DecodedImageFrame { *surface->snapshot_bitmap() }; }, - [](GC::Root const& source) -> Optional { + [](GC::Ref source) -> Optional { return Gfx::DecodedImageFrame { *source->bitmap() }; }, - [](GC::Root const& source) -> Optional { + [](GC::Ref source) -> Optional { return source->current_decoded_image_frame(); }, - [](GC::Root const& source) -> Optional { + [](GC::Ref source) -> Optional { return Gfx::DecodedImageFrame { *source->bitmap() }; }, - [](GC::Root const& source) -> Optional { + [](GC::Ref source) -> Optional { return Gfx::DecodedImageFrame { source->bitmap() }; }); if (!frame.has_value()) diff --git a/Libraries/LibWeb/XHR/FormDataIterator.cpp b/Libraries/LibWeb/XHR/FormDataIterator.cpp index 02547878ca..f168721fdb 100644 --- a/Libraries/LibWeb/XHR/FormDataIterator.cpp +++ b/Libraries/LibWeb/XHR/FormDataIterator.cpp @@ -64,8 +64,8 @@ JS::Object* FormDataIterator::next() return create_iterator_result_object(vm, JS::PrimitiveString::create(vm, entry.name), false); auto entry_value = entry.value.visit( - [&](GC::Root const& file) -> JS::Value { - return file.cell(); + [&](GC::Ref file) -> JS::Value { + return file; }, [&](String const& string) -> JS::Value { return JS::PrimitiveString::create(vm, string);