mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Split StructuredCloneHolder into Reader and Writer structs (#34792)
Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
9156ee3fa1
commit
1296c71f36
5 changed files with 67 additions and 111 deletions
|
@ -6,7 +6,7 @@
|
|||
//! (<https://html.spec.whatwg.org/multipage/#serializable-objects>).
|
||||
|
||||
use crate::dom::bindings::reflector::DomObject;
|
||||
use crate::dom::bindings::structuredclone::StructuredDataHolder;
|
||||
use crate::dom::bindings::structuredclone::{StructuredDataReader, StructuredDataWriter};
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
|
@ -22,11 +22,11 @@ pub struct StorageKey {
|
|||
/// <https://html.spec.whatwg.org/multipage/#serializable>
|
||||
pub trait Serializable: DomObject {
|
||||
/// <https://html.spec.whatwg.org/multipage/#serialization-steps>
|
||||
fn serialize(&self, sc_holder: &mut StructuredDataHolder) -> Result<StorageKey, ()>;
|
||||
fn serialize(&self, sc_writer: &mut StructuredDataWriter) -> Result<StorageKey, ()>;
|
||||
/// <https://html.spec.whatwg.org/multipage/#deserialization-steps>
|
||||
fn deserialize(
|
||||
owner: &GlobalScope,
|
||||
sc_holder: &mut StructuredDataHolder,
|
||||
sc_reader: &mut StructuredDataReader,
|
||||
extra_data: StorageKey,
|
||||
can_gc: CanGc,
|
||||
) -> Result<(), ()>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue