mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Support an equivalent of Trusted<T> for Rc<Promise> objects named TrustedPromise.
This commit is contained in:
parent
27d44c8d10
commit
498ccd41e8
7 changed files with 145 additions and 10 deletions
|
@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
|||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::reflector::Reflectable;
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::testbinding::TestBindingCallback;
|
||||
use dom::window::ScriptHelpers;
|
||||
use dom::xmlhttprequest::XHRTimeoutCallback;
|
||||
use euclid::length::Length;
|
||||
|
@ -68,6 +69,7 @@ struct OneshotTimer {
|
|||
pub enum OneshotTimerCallback {
|
||||
XhrTimeout(XHRTimeoutCallback),
|
||||
JsTimer(JsTimerTask),
|
||||
TestBindingCallback(TestBindingCallback),
|
||||
}
|
||||
|
||||
impl OneshotTimerCallback {
|
||||
|
@ -75,6 +77,7 @@ impl OneshotTimerCallback {
|
|||
match self {
|
||||
OneshotTimerCallback::XhrTimeout(callback) => callback.invoke(),
|
||||
OneshotTimerCallback::JsTimer(task) => task.invoke(this, js_timers),
|
||||
OneshotTimerCallback::TestBindingCallback(callback) => callback.invoke(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue