LibWeb: Default initialize StructuredDeserialize memory argument

This is optional in the spec, so let's make it actually optional at the
call site.
This commit is contained in:
Shannon Booth 2024-11-23 19:24:57 +13:00 committed by Andreas Kling
commit 9724c67be2
Notes: github-actions[bot] 2024-11-23 15:44:57 +00:00
8 changed files with 8 additions and 8 deletions

View file

@ -87,7 +87,7 @@ bool NavigationDestination::same_document() const
WebIDL::ExceptionOr<JS::Value> 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());
}
}

View file

@ -135,7 +135,7 @@ WebIDL::ExceptionOr<JS::Value> 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)

View file

@ -54,7 +54,7 @@ WebIDL::ExceptionOr<SerializationRecord> structured_serialize(JS::VM& vm, JS::Va
WebIDL::ExceptionOr<SerializationRecord> structured_serialize_for_storage(JS::VM& vm, JS::Value);
WebIDL::ExceptionOr<SerializationRecord> structured_serialize_internal(JS::VM& vm, JS::Value, bool for_storage, SerializationMemory&);
WebIDL::ExceptionOr<JS::Value> structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional<DeserializationMemory>);
WebIDL::ExceptionOr<JS::Value> structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional<DeserializationMemory> = {});
WebIDL::ExceptionOr<DeserializedRecord> structured_deserialize_internal(JS::VM& vm, ReadonlySpan<u32> const& serialized, JS::Realm& target_realm, DeserializationMemory& memory, Optional<size_t> position = {});
void serialize_boolean_primitive(SerializationRecord& serialized, JS::Value& value);

View file

@ -102,7 +102,7 @@ WebIDL::ExceptionOr<JS::Value> 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;