Remove Traceable/Untraceable from page.rs

This commit is contained in:
Manish Goregaokar 2014-09-29 06:47:45 +05:30
parent 22567762a0
commit 707a2870fa
9 changed files with 95 additions and 76 deletions

View file

@ -67,7 +67,7 @@ impl<'a> GlobalRef<'a> {
pub fn resource_task(&self) -> ResourceTask {
match *self {
Window(ref window) => window.page().resource_task.deref().clone(),
Window(ref window) => window.page().resource_task.clone(),
Worker(ref worker) => worker.resource_task().clone(),
}
}

View file

@ -50,6 +50,8 @@ use http::headers::request::HeaderCollection as RequestHeaderCollection;
use http::method::Method;
use std::io::timer::Timer;
use servo_msg::compositor_msg::ScriptListener;
use servo_msg::constellation_msg::ConstellationChan;
use layout_interface::{LayoutRPC, LayoutChan};
impl<T: Reflectable> JSTraceable for JS<T> {
fn trace(&self, trc: *mut JSTracer) {
@ -165,7 +167,7 @@ impl<T: JSTraceable> JSTraceable for RefCell<T> {
impl<T: JSTraceable> JSTraceable for Rc<T> {
fn trace(&self, trc: *mut JSTracer) {
self.deref().trace(trc)
(**self).trace(trc)
}
}
@ -228,6 +230,16 @@ impl<K: Eq+Hash+JSTraceable, V: JSTraceable> JSTraceable for HashMap<K, V> {
}
}
impl<A: JSTraceable, B: JSTraceable> JSTraceable for (A, B) {
#[inline]
fn trace(&self, trc: *mut JSTracer) {
let (ref a, ref b) = *self;
a.trace(trc);
b.trace(trc);
}
}
untraceable!(bool, f32, f64, String, Url)
untraceable!(uint, u8, u16, u32, u64)
untraceable!(int, i8, i16, i32, i64)
@ -243,6 +255,8 @@ untraceable!(SubpageId, WindowSizeData, PipelineId)
untraceable!(QuirksMode)
untraceable!(Cx)
untraceable!(ResponseHeaderCollection, RequestHeaderCollection, Method)
untraceable!(ConstellationChan)
untraceable!(LayoutChan)
impl<'a> JSTraceable for &'a str {
#[inline]
@ -264,3 +278,10 @@ impl JSTraceable for Box<ScriptListener+'static> {
// Do nothing
}
}
impl JSTraceable for Box<LayoutRPC+'static> {
#[inline]
fn trace(&self, _: *mut JSTracer) {
// Do nothing
}
}