mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Refactor util::prefs
operations to be methods on static struct.
This commit is contained in:
parent
307844a8c1
commit
22928f50ac
30 changed files with 166 additions and 162 deletions
|
@ -22,7 +22,7 @@ use std::cmp::{self, Ord, Ordering};
|
|||
use std::collections::HashMap;
|
||||
use std::default::Default;
|
||||
use std::rc::Rc;
|
||||
use util::prefs::get_pref;
|
||||
use util::prefs::PREFS;
|
||||
|
||||
#[derive(JSTraceable, PartialEq, Eq, Copy, Clone, HeapSizeOf, Hash, PartialOrd, Ord, Debug)]
|
||||
pub struct OneshotTimerHandle(i32);
|
||||
|
@ -214,7 +214,7 @@ impl OneshotTimers {
|
|||
}
|
||||
|
||||
pub fn slow_down(&self) {
|
||||
let duration = get_pref("js.timers.minimum_duration").as_u64().unwrap_or(1000);
|
||||
let duration = PREFS.get("js.timers.minimum_duration").as_u64().unwrap_or(1000);
|
||||
self.js_timers.set_min_duration(MsDuration::new(duration));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue