diff options
author | Keith Yeung <kungfukeith11@gmail.com> | 2016-10-28 03:09:05 -0700 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-11-11 14:52:20 -0800 |
commit | a5c2c0ba4b4691d6b2f189488890bf647c125d7d (patch) | |
tree | ca6e1f22d2d206851b68512dec993a88efc3984a /components/script/timers.rs | |
parent | 0b32b624a7746a10ddfa7701fa316dfdbd59ee54 (diff) | |
download | servo-a5c2c0ba4b4691d6b2f189488890bf647c125d7d.tar.gz servo-a5c2c0ba4b4691d6b2f189488890bf647c125d7d.zip |
Use a timer callback when re-establishing a connection
Diffstat (limited to 'components/script/timers.rs')
-rw-r--r-- | components/script/timers.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/components/script/timers.rs b/components/script/timers.rs index 34ac02b6589..6b67d6959e3 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -7,6 +7,7 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::reflector::Reflectable; use dom::bindings::str::DOMString; +use dom::eventsource::EventSourceTimeoutCallback; use dom::globalscope::GlobalScope; use dom::testbinding::TestBindingCallback; use dom::xmlhttprequest::XHRTimeoutCallback; @@ -67,6 +68,7 @@ struct OneshotTimer { #[derive(JSTraceable, HeapSizeOf)] pub enum OneshotTimerCallback { XhrTimeout(XHRTimeoutCallback), + EventSourceTimeout(EventSourceTimeoutCallback), JsTimer(JsTimerTask), TestBindingCallback(TestBindingCallback), } @@ -75,6 +77,7 @@ impl OneshotTimerCallback { fn invoke<T: Reflectable>(self, this: &T, js_timers: &JsTimers) { match self { OneshotTimerCallback::XhrTimeout(callback) => callback.invoke(), + OneshotTimerCallback::EventSourceTimeout(callback) => callback.invoke(), OneshotTimerCallback::JsTimer(task) => task.invoke(this, js_timers), OneshotTimerCallback::TestBindingCallback(callback) => callback.invoke(), } |