diff options
author | Corey Farwell <coreyf@rwell.org> | 2016-12-08 08:43:52 -1000 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2016-12-08 08:50:35 -1000 |
commit | 449f6337d4d42dcc93c015e63bba80068a109513 (patch) | |
tree | 6d1808c4d56f542a89754d514e86e85858655688 /components/script/dom/bindings/refcounted.rs | |
parent | 0fe94a6724a42da8f02a60d1efe18fdfc96885ae (diff) | |
download | servo-449f6337d4d42dcc93c015e63bba80068a109513.tar.gz servo-449f6337d4d42dcc93c015e63bba80068a109513.zip |
Rename `Reflectable` to `DomObject`.
Fixes https://github.com/servo/servo/issues/8473.
Diffstat (limited to 'components/script/dom/bindings/refcounted.rs')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index 41cc60b0210..dcf11626543 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -24,7 +24,7 @@ use core::nonzero::NonZero; use dom::bindings::js::Root; -use dom::bindings::reflector::{Reflectable, Reflector}; +use dom::bindings::reflector::{DomObject, Reflector}; use dom::bindings::trace::trace_reflector; use dom::promise::Promise; use js::jsapi::JSTracer; @@ -55,7 +55,7 @@ pub struct TrustedReference(*const libc::c_void); unsafe impl Send for TrustedReference {} impl TrustedReference { - fn new<T: Reflectable>(ptr: *const T) -> TrustedReference { + fn new<T: DomObject>(ptr: *const T) -> TrustedReference { TrustedReference(ptr as *const libc::c_void) } } @@ -122,7 +122,7 @@ impl TrustedPromise { /// DOM object is guaranteed to live at least as long as the last outstanding /// `Trusted<T>` instance. #[allow_unrooted_interior] -pub struct Trusted<T: Reflectable> { +pub struct Trusted<T: DomObject> { /// A pointer to the Rust DOM object of type T, but void to allow /// sending `Trusted<T>` between threads, regardless of T's sendability. refcount: Arc<TrustedReference>, @@ -130,9 +130,9 @@ pub struct Trusted<T: Reflectable> { phantom: PhantomData<T>, } -unsafe impl<T: Reflectable> Send for Trusted<T> {} +unsafe impl<T: DomObject> Send for Trusted<T> {} -impl<T: Reflectable> Trusted<T> { +impl<T: DomObject> Trusted<T> { /// Create a new `Trusted<T>` instance from an existing DOM pointer. The DOM object will /// be prevented from being GCed for the duration of the resulting `Trusted<T>` object's /// lifetime. @@ -164,7 +164,7 @@ impl<T: Reflectable> Trusted<T> { } } -impl<T: Reflectable> Clone for Trusted<T> { +impl<T: DomObject> Clone for Trusted<T> { fn clone(&self) -> Trusted<T> { Trusted { refcount: self.refcount.clone(), @@ -200,7 +200,7 @@ impl LiveDOMReferences { table.entry(&*promise).or_insert(vec![]).push(promise) } - fn addref<T: Reflectable>(&self, ptr: *const T) -> Arc<TrustedReference> { + fn addref<T: DomObject>(&self, ptr: *const T) -> Arc<TrustedReference> { let mut table = self.reflectable_table.borrow_mut(); let capacity = table.capacity(); let len = table.len(); |