mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
script: Stop using time
in DOM timers (#33262)
This switches to using `std::time` types for DOM timer operations, which allows removing our custom time units in favor of `Duration`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
8a0c7487e7
commit
a4ceb82ef5
13 changed files with 78 additions and 106 deletions
|
@ -6,6 +6,7 @@ use std::default::Default;
|
|||
use std::rc::Rc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use base::id::{PipelineId, PipelineNamespace};
|
||||
use crossbeam_channel::Receiver;
|
||||
|
@ -345,7 +346,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
callback,
|
||||
args,
|
||||
timeout,
|
||||
Duration::from_millis(timeout.max(0) as u64),
|
||||
IsInterval::NonInterval,
|
||||
)
|
||||
}
|
||||
|
@ -371,7 +372,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
|||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
callback,
|
||||
args,
|
||||
timeout,
|
||||
Duration::from_millis(timeout.max(0) as u64),
|
||||
IsInterval::Interval,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue