diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-12-02 16:54:43 -0800 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-12-29 13:53:49 -0500 |
commit | 9a7cd3113403fe44a8919f049720b67bfa92c9f1 (patch) | |
tree | bec170bff412ced10ce251846c828e5216ccf81e /components/script/timers.rs | |
parent | 2f059c15e76bd02a4cd6baa4a946f64ab8e6878a (diff) | |
download | servo-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.rs | 5 |
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; } |