diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-07-01 18:27:40 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-07-01 18:27:40 -0600 |
commit | bbb39082e0f640400546d2084a450a8675820a82 (patch) | |
tree | f531bb4d70d8eb6a1080d9711c29587c883bf0ce /components/script/timers.rs | |
parent | fc1e427ff9bb0e9891053ec1eba292530ebbe91a (diff) | |
parent | 4cf46bff2d00f33a8866dc6880c8f6178fdf81a4 (diff) | |
download | servo-bbb39082e0f640400546d2084a450a8675820a82.tar.gz servo-bbb39082e0f640400546d2084a450a8675820a82.zip |
Auto merge of #6529 - dwins:master, r=Manishearth
Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524. I had to make an additional change not mentioned in the ticket - adding the `#[feature]` to enable deriving custom traits but I assume that's expected at this time.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6529)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/timers.rs')
-rw-r--r-- | components/script/timers.rs | 19 |
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, |