Truly independent web browser
LibWeb: Take GC pointer containers moved into fields by rvalue reference
Shannon Booth577465d2fa9e
diff --git a/Libraries/LibWeb/CSS/CSSNumericArray.cpp b/Libraries/LibWeb/CSS/CSSNumericArray.cppindex cb3ffe71457..790880516fc 100644--- a/Libraries/LibWeb/CSS/CSSNumericArray.cpp+++ b/Libraries/LibWeb/CSS/CSSNumericArray.cpp@@ -17,7 +17,7 @@ GC::Ref<CSSNumericArray> CSSNumericArray::create(GC::RootVector<GC::Ref<CSSNumerreturn GC::Heap::the().allocate<CSSNumericArray>(move(values));}-CSSNumericArray::CSSNumericArray(Vector<GC::Ref<CSSNumericValue>> values)+CSSNumericArray::CSSNumericArray(Vector<GC::Ref<CSSNumericValue>>&& values): m_values(move(values)){}diff --git a/Libraries/LibWeb/CSS/CSSNumericArray.h b/Libraries/LibWeb/CSS/CSSNumericArray.hindex 08e656213f4..ddebc6ea292 100644--- a/Libraries/LibWeb/CSS/CSSNumericArray.h+++ b/Libraries/LibWeb/CSS/CSSNumericArray.h@@ -31,7 +31,7 @@ public:bool is_equal_numeric_values(GC::Ref<CSSNumericArray> other) const;private:- CSSNumericArray(Vector<GC::Ref<CSSNumericValue>>);+ CSSNumericArray(Vector<GC::Ref<CSSNumericValue>>&&);Vector<GC::Ref<CSSNumericValue>> m_values;};diff --git a/Libraries/LibWeb/CSS/CSSTransformValue.cpp b/Libraries/LibWeb/CSS/CSSTransformValue.cppindex 5e71b523102..e173c1db1a6 100644--- a/Libraries/LibWeb/CSS/CSSTransformValue.cpp+++ b/Libraries/LibWeb/CSS/CSSTransformValue.cpp@@ -41,7 +41,7 @@ WebIDL::ExceptionOr<GC::Ref<CSSTransformValue>> CSSTransformValue::create_for_coreturn CSSTransformValue::create(transforms);}-CSSTransformValue::CSSTransformValue(Vector<GC::Ref<CSSTransformComponent>> transforms)+CSSTransformValue::CSSTransformValue(Vector<GC::Ref<CSSTransformComponent>>&& transforms): CSSStyleValue(), m_transforms(move(transforms)){diff --git a/Libraries/LibWeb/CSS/CSSTransformValue.h b/Libraries/LibWeb/CSS/CSSTransformValue.hindex dea3b30ae58..c70b2011146 100644--- a/Libraries/LibWeb/CSS/CSSTransformValue.h+++ b/Libraries/LibWeb/CSS/CSSTransformValue.h@@ -35,7 +35,7 @@ public:virtual WebIDL::ExceptionOr<NonnullRefPtr<StyleValue const>> create_an_internal_representation(PropertyNameAndID const&, PerformTypeCheck) const override;private:- explicit CSSTransformValue(Vector<GC::Ref<CSSTransformComponent>>);+ explicit CSSTransformValue(Vector<GC::Ref<CSSTransformComponent>>&&);virtual void visit_edges(GC::Cell::Visitor&) override;Vector<GC::Ref<CSSTransformComponent>> m_transforms;diff --git a/Libraries/LibWeb/DOM/Slot.h b/Libraries/LibWeb/DOM/Slot.hindex 258c69129b6..7c9412d629a 100644--- a/Libraries/LibWeb/DOM/Slot.h+++ b/Libraries/LibWeb/DOM/Slot.h@@ -20,7 +20,7 @@ public:void set_slot_name(Utf16FlyString name) { m_name = move(name); }ReadonlySpan<DOM::Slottable> assigned_nodes_internal() const { return m_assigned_nodes; }- void set_assigned_nodes(Vector<DOM::Slottable> assigned_nodes) { m_assigned_nodes = move(assigned_nodes); }+ void set_assigned_nodes(Vector<DOM::Slottable>&& assigned_nodes) { m_assigned_nodes = move(assigned_nodes); }protected:void visit_edges(JS::Cell::Visitor&);diff --git a/Libraries/LibWeb/HTML/HistoryExecutor.cpp b/Libraries/LibWeb/HTML/HistoryExecutor.cppindex 948c85fc6a2..7879c75abc6 100644--- a/Libraries/LibWeb/HTML/HistoryExecutor.cpp+++ b/Libraries/LibWeb/HTML/HistoryExecutor.cpp@@ -98,7 +98,7 @@ CrossProcessId HistoryExecutor::request_history_operation(HistoryOperationParamereturn request_history_operation(move(parameters), {});}-CrossProcessId HistoryExecutor::request_history_operation(HistoryOperationParameters parameters, HistoryOperationState state)+CrossProcessId HistoryExecutor::request_history_operation(HistoryOperationParameters parameters, HistoryOperationState&& state){auto operation_id = m_page->client().allocate_cross_process_id();m_history_operations.set(operation_id, move(state));diff --git a/Libraries/LibWeb/HTML/HistoryExecutor.h b/Libraries/LibWeb/HTML/HistoryExecutor.hindex 8a7b2297e33..a0d53b9e28a 100644--- a/Libraries/LibWeb/HTML/HistoryExecutor.h+++ b/Libraries/LibWeb/HTML/HistoryExecutor.h@@ -56,7 +56,7 @@ public:};CrossProcessId request_history_operation(HistoryOperationParameters);- CrossProcessId request_history_operation(HistoryOperationParameters, HistoryOperationState);+ CrossProcessId request_history_operation(HistoryOperationParameters, HistoryOperationState&&);// Takes back a requested operation the UI process has not started.void revoke_history_operation(CrossProcessId operation_id);void complete_ui_history_operation(CrossProcessId operation_id, Optional<i32> target_entry_step);diff --git a/Libraries/LibWeb/HTML/Scripting/ModuleMap.cpp b/Libraries/LibWeb/HTML/Scripting/ModuleMap.cppindex 15c1116e19a..b04442511c7 100644--- a/Libraries/LibWeb/HTML/Scripting/ModuleMap.cpp+++ b/Libraries/LibWeb/HTML/Scripting/ModuleMap.cpp@@ -24,7 +24,7 @@ Optional<ModuleMap::Entry const&> ModuleMap::get(URL::URL const& url, Utf16Viewreturn m_values.get({ url, type });}-void ModuleMap::set(URL::URL const& url, Utf16View type, CallbackList callbacks)+void ModuleMap::set(URL::URL const& url, Utf16View type, CallbackList&& callbacks){VERIFY(!m_values.contains({ url, type }));m_values.set({ url, type }, move(callbacks));diff --git a/Libraries/LibWeb/HTML/Scripting/ModuleMap.h b/Libraries/LibWeb/HTML/Scripting/ModuleMap.hindex d38e1fd22ff..e3074727700 100644--- a/Libraries/LibWeb/HTML/Scripting/ModuleMap.h+++ b/Libraries/LibWeb/HTML/Scripting/ModuleMap.h@@ -58,7 +58,7 @@ public:Optional<Entry const&> get(URL::URL const& url, Utf16View type) const;- void set(URL::URL const& url, Utf16View type, CallbackList);+ void set(URL::URL const& url, Utf16View type, CallbackList&&);void append(URL::URL const& url, Utf16View type, CallbackFunction);void complete_fetch(URL::URL const& url, Utf16View type, GC::Ptr<ModuleScript>);diff --git a/Libraries/LibWeb/IndexedDB/IDBTransaction.cpp b/Libraries/LibWeb/IndexedDB/IDBTransaction.cppindex 644200aa8cd..18262320eba 100644--- a/Libraries/LibWeb/IndexedDB/IDBTransaction.cpp+++ b/Libraries/LibWeb/IndexedDB/IDBTransaction.cpp@@ -22,7 +22,7 @@ GC_DEFINE_ALLOCATOR(IDBTransaction);IDBTransaction::~IDBTransaction() = default;-IDBTransaction::IDBTransaction(GC::Ref<IDBDatabase> connection, TransactionMode mode, TransactionDurability durability, Vector<GC::Ref<ObjectStore>> scopes)+IDBTransaction::IDBTransaction(GC::Ref<IDBDatabase> connection, TransactionMode mode, TransactionDurability durability, Vector<GC::Ref<ObjectStore>>&& scopes): EventTarget(), m_connection(connection), m_mode(mode)diff --git a/Libraries/LibWeb/IndexedDB/IDBTransaction.h b/Libraries/LibWeb/IndexedDB/IDBTransaction.hindex 9cc97a6efbc..eee9d6b9f01 100644--- a/Libraries/LibWeb/IndexedDB/IDBTransaction.h+++ b/Libraries/LibWeb/IndexedDB/IDBTransaction.h@@ -85,7 +85,7 @@ public:{m_scope.remove_first_matching([&](auto& other) { return object_store == other; });}- void set_scope(Vector<GC::Ref<ObjectStore>> scope) { m_scope = move(scope); }+ void set_scope(Vector<GC::Ref<ObjectStore>>&& scope) { m_scope = move(scope); }GC::Ref<IDBObjectStore> get_or_create_object_store_handle(GC::Ref<ObjectStore>);GC::Ptr<IDBObjectStore> object_store_handle_for(GC::Ref<ObjectStore>);@@ -120,7 +120,7 @@ public:void notify_devtools_of_committed_changes();protected:- IDBTransaction(GC::Ref<IDBDatabase>, TransactionMode, TransactionDurability, Vector<GC::Ref<ObjectStore>>);+ IDBTransaction(GC::Ref<IDBDatabase>, TransactionMode, TransactionDurability, Vector<GC::Ref<ObjectStore>>&&);virtual void visit_edges(Visitor& visitor) override;virtual EventTarget* get_parent(DOM::Event const&) override;diff --git a/Libraries/LibWeb/IndexedDB/Internal/MutationLog.cpp b/Libraries/LibWeb/IndexedDB/Internal/MutationLog.cppindex b680c2c5f3a..df8797ab211 100644--- a/Libraries/LibWeb/IndexedDB/Internal/MutationLog.cpp+++ b/Libraries/LibWeb/IndexedDB/Internal/MutationLog.cpp@@ -103,7 +103,7 @@ void MutationLog::note_key_generator_changed(u64 old_value)m_entries.append(KeyGeneratorChanged { old_value });}-void MutationLog::note_records_deleted(Vector<ObjectStoreRecord> records)+void MutationLog::note_records_deleted(Vector<ObjectStoreRecord>&& records){m_entries.append(RecordsDeleted { move(records) });}@@ -113,7 +113,7 @@ void MutationLog::note_record_stored(GC::Ref<Key> key)m_entries.append(RecordStored { key });}-void MutationLog::note_index_records_deleted(GC::Ref<Index> index, Vector<IndexRecord> records)+void MutationLog::note_index_records_deleted(GC::Ref<Index> index, Vector<IndexRecord>&& records){m_entries.append(IndexRecordsDeleted { index, move(records) });}diff --git a/Libraries/LibWeb/IndexedDB/Internal/MutationLog.h b/Libraries/LibWeb/IndexedDB/Internal/MutationLog.hindex f3a4bdff3ae..848e355c908 100644--- a/Libraries/LibWeb/IndexedDB/Internal/MutationLog.h+++ b/Libraries/LibWeb/IndexedDB/Internal/MutationLog.h@@ -47,13 +47,13 @@ public:void note_key_generator_changed(u64 old_value);// Record that records were deleted from the object store, saving them for re-insertion on revert.- void note_records_deleted(Vector<ObjectStoreRecord>);+ void note_records_deleted(Vector<ObjectStoreRecord>&&);// Record that a new record was stored in the object store, saving the key for deletion on revert.void note_record_stored(GC::Ref<Key> key);// Record that records were deleted from an index, saving them for re-insertion on revert.- void note_index_records_deleted(GC::Ref<Index>, Vector<IndexRecord>);+ void note_index_records_deleted(GC::Ref<Index>, Vector<IndexRecord>&&);// Record that a new record was stored in an index, saving it for deletion on revert.void note_index_record_stored(GC::Ref<Index>, IndexRecord);diff --git a/Libraries/LibWeb/IndexedDB/Internal/ObjectStore.cpp b/Libraries/LibWeb/IndexedDB/Internal/ObjectStore.cppindex 477380db8df..6c745fa24a6 100644--- a/Libraries/LibWeb/IndexedDB/Internal/ObjectStore.cpp+++ b/Libraries/LibWeb/IndexedDB/Internal/ObjectStore.cpp@@ -128,7 +128,7 @@ void ObjectStore::clear_records(){GC::ConservativeVector deleted_records { move(m_records) };if (m_mutation_log && !deleted_records.is_empty())- m_mutation_log->note_records_deleted(deleted_records);+ m_mutation_log->note_records_deleted(move(deleted_records));}// https://w3c.github.io/IndexedDB/#generate-a-keydiff --git a/Libraries/LibWeb/XPath/XPathResult.cpp b/Libraries/LibWeb/XPath/XPathResult.cppindex dba2bf49975..d76d2bda1e3 100644--- a/Libraries/LibWeb/XPath/XPathResult.cpp+++ b/Libraries/LibWeb/XPath/XPathResult.cpp@@ -50,7 +50,7 @@ void XPathResult::set_boolean(bool boolean_value)m_boolean_value = boolean_value;}-void XPathResult::set_node_set(Vector<GC::Ptr<DOM::Node>> node_set, unsigned short type)+void XPathResult::set_node_set(Vector<GC::Ptr<DOM::Node>>&& node_set, unsigned short type){if (type >= XPathResult::UNORDERED_NODE_ITERATOR_TYPE && type <= XPathResult::FIRST_ORDERED_NODE_TYPE)m_result_type = type;diff --git a/Libraries/LibWeb/XPath/XPathResult.h b/Libraries/LibWeb/XPath/XPathResult.hindex aba89180ecf..49b7d883ff9 100644--- a/Libraries/LibWeb/XPath/XPathResult.h+++ b/Libraries/LibWeb/XPath/XPathResult.h@@ -50,7 +50,7 @@ public:void set_number(WebIDL::Double number_value);void set_string(Utf16String string_value);void set_boolean(bool boolean_value);- void set_node_set(Vector<GC::Ptr<DOM::Node>> node_set, unsigned short type);+ void set_node_set(Vector<GC::Ptr<DOM::Node>>&& node_set, unsigned short type);private:WebIDL::UnsignedShort m_result_type { 0 };