aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/timers.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-12-02 16:54:43 -0800
committerJosh Matthews <josh@joshmatthews.net>2014-12-29 13:53:49 -0500
commit9a7cd3113403fe44a8919f049720b67bfa92c9f1 (patch)
treebec170bff412ced10ce251846c828e5216ccf81e /components/script/timers.rs
parent2f059c15e76bd02a4cd6baa4a946f64ab8e6878a (diff)
downloadservo-9a7cd3113403fe44a8919f049720b67bfa92c9f1.tar.gz
servo-9a7cd3113403fe44a8919f049720b67bfa92c9f1.zip
Force all messages to worker tasks to send a TrustedWorkerAddress along with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed.
Diffstat (limited to 'components/script/timers.rs')
-rw-r--r--components/script/timers.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/components/script/timers.rs b/components/script/timers.rs
index 082ea626790..0502bdfcd38 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -100,7 +100,7 @@ impl TimerManager {
timeout: i32,
is_interval: IsInterval,
source: TimerSource,
- script_chan: ScriptChan)
+ script_chan: Box<ScriptChan+Send>)
-> i32 {
let timeout = cmp::max(0, timeout) as u64;
let handle = self.next_timer_handle.get();
@@ -136,8 +136,7 @@ impl TimerManager {
let id = select.wait();
if id == timeout_handle.id() {
timeout_port.recv();
- let ScriptChan(ref chan) = script_chan;
- chan.send(ScriptMsg::FireTimer(source, TimerId(handle)));
+ script_chan.send(ScriptMsg::FireTimer(source, TimerId(handle)));
if is_interval == IsInterval::NonInterval {
break;
}