mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
continue messageport, transferable, postmessage options
This commit is contained in:
parent
c3b17c1201
commit
2f8932a6a1
100 changed files with 2456 additions and 1171 deletions
|
@ -4,26 +4,19 @@
|
|||
|
||||
//! Trait representing the concept of [transferable objects]
|
||||
//! (https://html.spec.whatwg.org/multipage/#transferable-objects).
|
||||
use crate::dom::bindings::reflector::DomObject;
|
||||
use js::jsapi::{JSContext, JSStructuredCloneReader, MutableHandleObject};
|
||||
use std::os::raw;
|
||||
|
||||
pub trait Transferable : DomObject {
|
||||
fn transfer(
|
||||
&self,
|
||||
closure: *mut raw::c_void,
|
||||
content: *mut *mut raw::c_void,
|
||||
extra_data: *mut u64,
|
||||
) -> bool;
|
||||
use crate::dom::bindings::reflector::DomObject;
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::bindings::structuredclone::StructuredDataHolder;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use js::jsapi::MutableHandleObject;
|
||||
|
||||
pub trait Transferable: DomObject {
|
||||
fn transfer(&self, sc_holder: &mut StructuredDataHolder) -> Result<u64, ()>;
|
||||
fn transfer_receive(
|
||||
cx: *mut JSContext,
|
||||
r: *mut JSStructuredCloneReader,
|
||||
closure: *mut raw::c_void,
|
||||
content: *mut raw::c_void,
|
||||
owner: &DomRoot<GlobalScope>,
|
||||
sc_holder: &mut StructuredDataHolder,
|
||||
extra_data: u64,
|
||||
return_object: MutableHandleObject,
|
||||
) -> bool;
|
||||
fn detached(&self) -> Option<bool> { None }
|
||||
fn set_detached(&self, _value: bool) { }
|
||||
fn transferable(&self) -> bool { false }
|
||||
) -> Result<(), ()>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue