aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorPawel Kondzior <pawel@kondzior.com>2015-02-19 11:20:55 +0700
committerPawel Kondzior <pawel@kondzior.com>2015-02-24 05:33:27 +0100
commitc2961c94b49a401d647e3f10cf04cd74aa7287c8 (patch)
tree710a28fef8f76006e6978ab37ee7521774fd487d /components/script/dom
parentdc31d96f65246def19cb7a23f3a62795cd7344a1 (diff)
downloadservo-c2961c94b49a401d647e3f10cf04cd74aa7287c8.tar.gz
servo-c2961c94b49a401d647e3f10cf04cd74aa7287c8.zip
Add thaw/freeze messages that can suspend/resume webcontent timers #4907
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/window.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index fcc56776c8d..2ec968ed6e5 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -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 {