Expand description
Weak-referenceable JS-managed DOM objects.
IDL interfaces marked as weakReferenceable
in Bindings.conf
automatically implement the WeakReferenceable
trait in codegen.
The instance object is responsible for setting None
in its own
own WeakBox
when it is collected, through the DOM_WEAK_SLOT
slot. When all associated WeakRef
values are dropped, the
WeakBox
itself is dropped too.
Structsยง
- DOMTracker ๐
- Mutable
Weak ๐Ref A mutable weak reference to a JS-managed DOM object. On tracing, the contained weak reference is dropped if the pointee was already collected. - WeakBox ๐The inner box of weak references, public for the finalization in codegen.
- WeakRef ๐A weak reference to a JS-managed DOM object.
- Weak
RefEntry ๐An entry of a vector of weak references. Passed to the closure given toWeakRefVec::update
. - Weak
RefVec ๐A vector of weak references. On tracing, the vector retains only references which still point to live objects.
Constantsยง
- DOM_
WEAK_ ๐SLOT The index of the slot wherein a pointer to the weak holder cell is stored for weak-referenceable bindings. We use slot 1 for holding it, this is unsafe for globals, we disallow weak-referenceable globals directly in codegen.
Traitsยง
- Weak
Referenceable ๐Trait implemented by weak-referenceable interfaces.