Rename Root<T> to DomRoot<T>

In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
This commit is contained in:
Anthony Ramine 2017-09-26 01:53:40 +02:00
parent 577370746e
commit f87c2a8d76
291 changed files with 1774 additions and 1770 deletions

View file

@ -13,7 +13,7 @@
use core::nonzero::NonZero;
use dom::bindings::reflector::DomObject;
use dom::bindings::root::Root;
use dom::bindings::root::DomRoot;
use dom::bindings::trace::JSTraceable;
use heapsize::HeapSizeOf;
use js::jsapi::{JSTracer, JS_GetReservedSlot, JS_SetReservedSlot};
@ -84,9 +84,9 @@ impl<T: WeakReferenceable> WeakRef<T> {
value.downgrade()
}
/// Root a weak reference. Returns `None` if the object was already collected.
pub fn root(&self) -> Option<Root<T>> {
unsafe { &*self.ptr.get() }.value.get().map(Root::new)
/// DomRoot a weak reference. Returns `None` if the object was already collected.
pub fn root(&self) -> Option<DomRoot<T>> {
unsafe { &*self.ptr.get() }.value.get().map(DomRoot::new)
}
/// Return whether the weakly-referenced object is still alive.
@ -179,9 +179,9 @@ impl<T: WeakReferenceable> MutableWeakRef<T> {
}
}
/// Root a mutable weak reference. Returns `None` if the object
/// DomRoot a mutable weak reference. Returns `None` if the object
/// was already collected.
pub fn root(&self) -> Option<Root<T>> {
pub fn root(&self) -> Option<DomRoot<T>> {
unsafe { &*self.cell.get() }.as_ref().and_then(WeakRef::root)
}
}