diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-04 13:06:37 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2016-10-06 21:35:51 +0200 |
commit | 991801488c97fd74d814c6591064379400e06d1e (patch) | |
tree | 5e69e1c27800a3f7916b941ebfbad30b7cb59a1c /components/script/dom/xmlhttprequest.rs | |
parent | 5d8979237b4bd44ab336f1c54ce728a33218da38 (diff) | |
download | servo-991801488c97fd74d814c6591064379400e06d1e.tar.gz servo-991801488c97fd74d814c6591064379400e06d1e.zip |
Move timers to GlobalScope
Diffstat (limited to 'components/script/dom/xmlhttprequest.rs')
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index a5b09193b7f..7a586cfe6a1 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -1077,15 +1077,14 @@ impl XMLHttpRequest { xhr: Trusted::new(self), generation_id: self.generation_id.get(), }); - let global = self.global(); let duration = Length::new(duration_ms as u64); - *self.timeout_cancel.borrow_mut() = Some(global.r().schedule_callback(callback, duration)); + *self.timeout_cancel.borrow_mut() = + Some(self.global_scope().schedule_callback(callback, duration)); } fn cancel_timeout(&self) { if let Some(handle) = self.timeout_cancel.borrow_mut().take() { - let global = self.global(); - global.r().unschedule_callback(handle); + self.global_scope().unschedule_callback(handle); } } |