aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/timers.rs
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2016-10-28 03:09:05 -0700
committerKeith Yeung <kungfukeith11@gmail.com>2016-11-11 14:52:20 -0800
commita5c2c0ba4b4691d6b2f189488890bf647c125d7d (patch)
treeca6e1f22d2d206851b68512dec993a88efc3984a /components/script/timers.rs
parent0b32b624a7746a10ddfa7701fa316dfdbd59ee54 (diff)
downloadservo-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.rs3
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(),
}