diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index bb377395e43..f423b3f7f7a 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -4388,7 +4388,7 @@ void Document::restore_the_history_object_state(GC::Refclassic_history_api_state(), target_realm, {}); + auto state_or_error = HTML::structured_deserialize(target_realm.vm(), entry->classic_history_api_state(), target_realm); if (state_or_error.is_error()) m_history->set_state(JS::js_null()); else diff --git a/Libraries/LibWeb/HTML/NavigationDestination.cpp b/Libraries/LibWeb/HTML/NavigationDestination.cpp index e25d1b094a6..e638da8ce8e 100644 --- a/Libraries/LibWeb/HTML/NavigationDestination.cpp +++ b/Libraries/LibWeb/HTML/NavigationDestination.cpp @@ -87,7 +87,7 @@ bool NavigationDestination::same_document() const WebIDL::ExceptionOr NavigationDestination::get_state() { // The getState() method steps are to return StructuredDeserialize(this's state). - return structured_deserialize(vm(), m_state, realm(), {}); + return structured_deserialize(vm(), m_state, realm()); } } diff --git a/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp b/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp index 694704dbf27..f44e6ca4b0e 100644 --- a/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp +++ b/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp @@ -135,7 +135,7 @@ WebIDL::ExceptionOr NavigationHistoryEntry::get_state() // 2. Return StructuredDeserialize(this's session history entry's navigation API state). Rethrow any exceptions. // NOTE: This can in theory throw an exception, if attempting to deserialize a large ArrayBuffer // when not enough memory is available. - return structured_deserialize(vm(), m_session_history_entry->navigation_api_state(), realm(), {}); + return structured_deserialize(vm(), m_session_history_entry->navigation_api_state(), realm()); } void NavigationHistoryEntry::set_ondispose(WebIDL::CallbackType* event_handler) diff --git a/Libraries/LibWeb/HTML/StructuredSerialize.h b/Libraries/LibWeb/HTML/StructuredSerialize.h index f38c0573672..843d87ca5d6 100644 --- a/Libraries/LibWeb/HTML/StructuredSerialize.h +++ b/Libraries/LibWeb/HTML/StructuredSerialize.h @@ -54,7 +54,7 @@ WebIDL::ExceptionOr structured_serialize(JS::VM& vm, JS::Va WebIDL::ExceptionOr structured_serialize_for_storage(JS::VM& vm, JS::Value); WebIDL::ExceptionOr structured_serialize_internal(JS::VM& vm, JS::Value, bool for_storage, SerializationMemory&); -WebIDL::ExceptionOr structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional); +WebIDL::ExceptionOr structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional = {}); WebIDL::ExceptionOr structured_deserialize_internal(JS::VM& vm, ReadonlySpan const& serialized, JS::Realm& target_realm, DeserializationMemory& memory, Optional position = {}); void serialize_boolean_primitive(SerializationRecord& serialized, JS::Value& value); diff --git a/Libraries/LibWeb/HTML/UniversalGlobalScope.cpp b/Libraries/LibWeb/HTML/UniversalGlobalScope.cpp index 6847563d86a..49bbbbe86b3 100644 --- a/Libraries/LibWeb/HTML/UniversalGlobalScope.cpp +++ b/Libraries/LibWeb/HTML/UniversalGlobalScope.cpp @@ -102,7 +102,7 @@ WebIDL::ExceptionOr UniversalGlobalScopeMixin::structured_clone(JS::V // 2. Let deserializeRecord be ? StructuredDeserializeWithTransfer(serialized, this's relevant realm). // FIXME: Use WithTransfer variant of the AO - auto deserialized = TRY(structured_deserialize(vm, serialized, relevant_realm(this_impl()), {})); + auto deserialized = TRY(structured_deserialize(vm, serialized, relevant_realm(this_impl()))); // 3. Return deserializeRecord.[[Deserialized]]. return deserialized; diff --git a/Libraries/LibWeb/HighResolutionTime/Performance.cpp b/Libraries/LibWeb/HighResolutionTime/Performance.cpp index 6c0cdde8ff3..5fbee3f104b 100644 --- a/Libraries/LibWeb/HighResolutionTime/Performance.cpp +++ b/Libraries/LibWeb/HighResolutionTime/Performance.cpp @@ -298,7 +298,7 @@ WebIDL::ExceptionOr> Performance::measur auto record = TRY(HTML::structured_serialize(vm, start_or_measure_options_dictionary_object->detail)); // 2. Set entry's detail to the result of calling the StructuredDeserialize algorithm on record and the current realm. - detail = TRY(HTML::structured_deserialize(vm, record, realm, Optional {})); + detail = TRY(HTML::structured_deserialize(vm, record, realm)); } // 2. Otherwise, set it to null. diff --git a/Libraries/LibWeb/Streams/AbstractOperations.cpp b/Libraries/LibWeb/Streams/AbstractOperations.cpp index 59e17d61a26..2673142b203 100644 --- a/Libraries/LibWeb/Streams/AbstractOperations.cpp +++ b/Libraries/LibWeb/Streams/AbstractOperations.cpp @@ -5397,7 +5397,7 @@ WebIDL::ExceptionOr structured_clone(JS::Realm& realm, JS::Value valu auto serialized = TRY(HTML::structured_serialize(vm, value)); // 2. Return ? StructuredDeserialize(serialized, the current Realm). - return TRY(HTML::structured_deserialize(vm, serialized, realm, {})); + return TRY(HTML::structured_deserialize(vm, serialized, realm)); } // https://streams.spec.whatwg.org/#close-sentinel diff --git a/Libraries/LibWeb/UserTiming/PerformanceMark.cpp b/Libraries/LibWeb/UserTiming/PerformanceMark.cpp index 40e40af47cc..22683c14cd7 100644 --- a/Libraries/LibWeb/UserTiming/PerformanceMark.cpp +++ b/Libraries/LibWeb/UserTiming/PerformanceMark.cpp @@ -86,7 +86,7 @@ WebIDL::ExceptionOr> PerformanceMark::construct_impl(JS auto record = TRY(HTML::structured_serialize(vm, mark_options.detail)); // 2. Set entry's detail to the result of calling the StructuredDeserialize algorithm on record and the current realm. - detail = TRY(HTML::structured_deserialize(vm, record, realm, Optional {})); + detail = TRY(HTML::structured_deserialize(vm, record, realm)); } // 2. Create a new PerformanceMark object (entry) with the current global object's realm.