1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

LibWeb: Add spec steps to StructuredSerialize

In preparation for serializing more types, let's move the implementation
closer to the steps in the spec.
This commit is contained in:
Andrew Kaster 2023-08-21 15:15:05 -06:00 committed by Andreas Kling
parent 96600e77c2
commit f3cf7496a1
2 changed files with 70 additions and 27 deletions

View file

@ -21,7 +21,11 @@
namespace Web::HTML {
using SerializationRecord = Vector<u32>;
using SerializationMemory = HashMap<JS::Handle<JS::Value>, u32>;
struct SerializationRange {
u64 start = 0;
u64 end = 0;
};
using SerializationMemory = HashMap<JS::Handle<JS::Value>, SerializationRange>;
WebIDL::ExceptionOr<SerializationRecord> structured_serialize(JS::VM& vm, JS::Value);
WebIDL::ExceptionOr<SerializationRecord> structured_serialize_for_storage(JS::VM& vm, JS::Value);