Implement an Unrooted smart pointer to replace JS when it is not traced.

This commit is contained in:
Ms2ger 2015-02-04 11:07:48 +01:00
parent f451291782
commit 147dadce89
11 changed files with 137 additions and 63 deletions

View file

@ -28,7 +28,6 @@
use dom::bindings::js::JS;
use dom::bindings::refcounted::Trusted;
use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler};
use dom::node::{Node, TrustedNodeAddress};
use script_task::ScriptChan;
use cssparser::RGBA;
@ -257,13 +256,3 @@ impl JSTraceable for Box<LayoutRPC+'static> {
// Do nothing
}
}
impl JSTraceable for TrustedNodeAddress {
fn trace(&self, s: *mut JSTracer) {
let TrustedNodeAddress(addr) = *self;
let node = addr as *const Node;
unsafe {
JS::from_raw(node).trace(s)
}
}
}