mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Add thaw/freeze messages that can suspend/resume webcontent timers #4907
This commit is contained in:
parent
dc31d96f65
commit
c2961c94b4
6 changed files with 105 additions and 9 deletions
|
@ -335,6 +335,8 @@ pub trait WindowHelpers {
|
|||
fn load_url(self, href: DOMString);
|
||||
fn handle_fire_timer(self, timer_id: TimerId);
|
||||
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Temporary<Window>>;
|
||||
fn thaw(self);
|
||||
fn freeze(self);
|
||||
}
|
||||
|
||||
pub trait ScriptHelpers {
|
||||
|
@ -404,6 +406,15 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
|
|||
fn IndexedGetter(self, _index: u32, _found: &mut bool) -> Option<Temporary<Window>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn thaw(self) {
|
||||
self.timers.resume();
|
||||
}
|
||||
|
||||
fn freeze(self) {
|
||||
self.timers.suspend();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Window {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue