aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/timers.rs
diff options
context:
space:
mode:
authorDavid Winslow <cdwinslow@gmail.com>2015-07-01 16:31:07 -0400
committerDavid Winslow <cdwinslow@gmail.com>2015-07-01 18:27:06 -0400
commit4cf46bff2d00f33a8866dc6880c8f6178fdf81a4 (patch)
treebfa5da23abf5d88edd40c26486e34b0cf40383d9 /components/script/timers.rs
parente958d92be6c35234bcffce2d4e74ece585de02e4 (diff)
downloadservo-4cf46bff2d00f33a8866dc6880c8f6178fdf81a4.tar.gz
servo-4cf46bff2d00f33a8866dc6880c8f6178fdf81a4.zip
Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524
Diffstat (limited to 'components/script/timers.rs')
-rw-r--r--components/script/timers.rs19
1 files changed, 7 insertions, 12 deletions
diff --git a/components/script/timers.rs b/components/script/timers.rs
index fbdad279204..0a0a37e0a7a 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -29,12 +29,10 @@ use std::hash::{Hash, Hasher};
use std::rc::Rc;
use std::default::Default;
-#[derive(PartialEq, Eq)]
-#[jstraceable]
-#[derive(Copy, Clone)]
+#[derive(JSTraceable, PartialEq, Eq, Copy, Clone)]
pub struct TimerId(i32);
-#[jstraceable]
+#[derive(JSTraceable)]
#[privatize]
struct TimerHandle {
handle: TimerId,
@@ -42,8 +40,7 @@ struct TimerHandle {
control_chan: Option<Sender<TimerControlMsg>>,
}
-#[jstraceable]
-#[derive(Clone)]
+#[derive(JSTraceable, Clone)]
pub enum TimerCallback {
StringTimerCallback(DOMString),
FunctionTimerCallback(Rc<Function>)
@@ -68,7 +65,7 @@ impl TimerHandle {
}
}
-#[jstraceable]
+#[derive(JSTraceable)]
#[privatize]
pub struct TimerManager {
active_timers: DOMRefCell<HashMap<TimerId, TimerHandle>>,
@@ -85,16 +82,14 @@ impl Drop for TimerManager {
}
// Enum allowing more descriptive values for the is_interval field
-#[jstraceable]
-#[derive(PartialEq, Copy, Clone)]
+#[derive(JSTraceable, PartialEq, Copy, Clone)]
pub enum IsInterval {
Interval,
NonInterval,
}
// Messages sent control timers from script task
-#[jstraceable]
-#[derive(PartialEq, Copy, Clone, Debug)]
+#[derive(JSTraceable, PartialEq, Copy, Clone, Debug)]
pub enum TimerControlMsg {
Cancel,
Suspend,
@@ -105,7 +100,7 @@ pub enum TimerControlMsg {
// (ie. function value to invoke and all arguments to pass
// to the function when calling it)
// TODO: Handle rooting during fire_timer when movable GC is turned on
-#[jstraceable]
+#[derive(JSTraceable)]
#[privatize]
struct TimerData {
is_interval: IsInterval,