mirror of
https://github.com/servo/servo.git
synced 2025-09-30 16:49:16 +01:00
Implement an Unrooted smart pointer to replace JS when it is not traced.
This commit is contained in:
parent
f451291782
commit
147dadce89
11 changed files with 137 additions and 63 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue