aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/trace.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-26 01:53:40 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-26 09:49:10 +0200
commitf87c2a8d7616112ca924e30292db2d244cf87eec (patch)
tree7344afe7ec0ec1ac7d1d13f5385111ee9c4be332 /components/script/dom/bindings/trace.rs
parent577370746e2ce3da7fa25a20b8e1bbeed319df65 (diff)
downloadservo-f87c2a8d7616112ca924e30292db2d244cf87eec.tar.gz
servo-f87c2a8d7616112ca924e30292db2d244cf87eec.zip
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.
Diffstat (limited to 'components/script/dom/bindings/trace.rs')
-rw-r--r--components/script/dom/bindings/trace.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 56b48b5750c..c367df5ee56 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -42,7 +42,7 @@ use dom::bindings::cell::DomRefCell;
use dom::bindings::error::Error;
use dom::bindings::refcounted::{Trusted, TrustedPromise};
use dom::bindings::reflector::{DomObject, Reflector};
-use dom::bindings::root::{Dom, Root};
+use dom::bindings::root::{Dom, DomRoot};
use dom::bindings::str::{DOMString, USVString};
use dom::bindings::utils::WindowProxyHandler;
use dom::document::PendingRestyle;
@@ -710,7 +710,7 @@ impl RootedTraceableSet {
/// Roots any JSTraceable thing
///
-/// If you have a valid DomObject, use Root.
+/// If you have a valid DomObject, use DomRoot.
/// If you have GC things like *mut JSObject or JSVal, use rooted!.
/// If you have an arbitrary number of DomObjects to root, use rooted_vec!.
/// If you know what you're doing, use this.
@@ -720,7 +720,7 @@ pub struct RootedTraceable<'a, T: 'static + JSTraceable> {
}
impl<'a, T: JSTraceable + 'static> RootedTraceable<'a, T> {
- /// Root a JSTraceable thing for the life of this RootedTraceable
+ /// DomRoot a JSTraceable thing for the life of this RootedTraceable
pub fn new(traceable: &'a T) -> RootedTraceable<'a, T> {
unsafe {
RootedTraceableSet::add(traceable);
@@ -741,7 +741,7 @@ impl<'a, T: JSTraceable + 'static> Drop for RootedTraceable<'a, T> {
/// Roots any JSTraceable thing
///
-/// If you have a valid DomObject, use Root.
+/// If you have a valid DomObject, use DomRoot.
/// If you have GC things like *mut JSObject or JSVal, use rooted!.
/// If you have an arbitrary number of DomObjects to root, use rooted_vec!.
/// If you know what you're doing, use this.
@@ -757,7 +757,7 @@ unsafe impl<T: JSTraceable + 'static> JSTraceable for RootedTraceableBox<T> {
}
impl<T: JSTraceable + 'static> RootedTraceableBox<T> {
- /// Root a JSTraceable thing for the life of this RootedTraceable
+ /// DomRoot a JSTraceable thing for the life of this RootedTraceable
pub fn new(traceable: T) -> RootedTraceableBox<T> {
let traceable = Box::into_raw(box traceable);
unsafe {
@@ -804,7 +804,7 @@ impl<T: JSTraceable + 'static> Drop for RootedTraceableBox<T> {
/// A vector of items to be rooted with `RootedVec`.
/// Guaranteed to be empty when not rooted.
/// Usage: `rooted_vec!(let mut v);` or if you have an
-/// iterator of `Root`s, `rooted_vec!(let v <- iterator);`.
+/// iterator of `DomRoot`s, `rooted_vec!(let v <- iterator);`.
#[allow(unrooted_must_root)]
#[derive(JSTraceable)]
#[allow_unrooted_interior]
@@ -844,7 +844,7 @@ impl<'a, T: 'static + JSTraceable + DomObject> RootedVec<'a, Dom<T>> {
/// Create a vector of items of type Dom<T> that is rooted for
/// the lifetime of this struct
pub fn from_iter<I>(root: &'a mut RootableVec<Dom<T>>, iter: I) -> Self
- where I: Iterator<Item = Root<T>>
+ where I: Iterator<Item = DomRoot<T>>
{
unsafe {
RootedTraceableSet::add(root);