/* * Copyright (c) 2022, Daniel Ehrenberg * Copyright (c) 2022, Andrew Kaster * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include // Structured serialize is an entirely different format from IPC because: // - It contains representation of type information // - It may contain circularities // - It is restricted to JS values namespace Web::HTML { using SerializationRecord = Vector; using SerializationMemory = HashMap, u32>; WebIDL::ExceptionOr structured_serialize(JS::VM& vm, JS::Value); WebIDL::ExceptionOr structured_serialize_for_storage(JS::VM& vm, JS::Value); WebIDL::ExceptionOr structured_serialize_internal(JS::VM& vm, JS::Value, bool for_storage, Optional); WebIDL::ExceptionOr structured_deserialize(JS::VM& vm, SerializationRecord const& serialized, JS::Realm& target_realm, Optional); // TODO: structured_[de]serialize_with_transfer }