aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/script_task.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-07-21 11:14:50 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-07-21 11:14:50 -0400
commit1578189d03d8e5a6e0470cb18cb13b1c988086a3 (patch)
tree1361ce32e17328108f422f7ef7e105cd05b0e702 /src/components/script/script_task.rs
parent4b3a78e54bc8132e67b96725236fa3d6914f59c4 (diff)
parent0b5a1b2ad9932ed709cae65abbdc104d8e61045c (diff)
downloadservo-1578189d03d8e5a6e0470cb18cb13b1c988086a3.tar.gz
servo-1578189d03d8e5a6e0470cb18cb13b1c988086a3.zip
Merge pull request #2850 from ebalint/1992_move_timer_firing_impl
Move timer firing implemention into Window #1992
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r--src/components/script/script_task.rs25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index e173a37f762..4b86bafcdde 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -32,10 +32,8 @@ use layout_interface;
use page::{Page, IterablePage, Frame};
use geom::point::Point2D;
-use js::jsapi::JS_CallFunctionValue;
use js::jsapi::{JS_SetWrapObjectCallbacks, JS_SetGCZeal, JS_DEFAULT_ZEAL_FREQ, JS_GC};
use js::jsapi::{JSContext, JSRuntime};
-use js::jsval::NullValue;
use js::rust::{Cx, RtUtils};
use js::rust::with_compartment;
use js;
@@ -51,7 +49,6 @@ use servo_util::task::send_on_failure;
use std::cell::RefCell;
use std::comm::{channel, Sender, Receiver};
use std::mem::replace;
-use std::ptr;
use std::rc::Rc;
use std::task::TaskBuilder;
use url::Url;
@@ -417,27 +414,7 @@ impl ScriptTask {
pipeline ID not associated with this script task. This is a bug.");
let frame = page.frame();
let window = frame.get_ref().window.root();
-
- let this_value = window.deref().reflector().get_jsobject();
-
- let data = match window.deref().active_timers.deref().borrow().find(&timer_id) {
- None => return,
- Some(timer_handle) => timer_handle.data,
- };
-
- // TODO: Support extra arguments. This requires passing a `*JSVal` array as `argv`.
- let cx = self.get_cx();
- with_compartment(cx, this_value, || {
- let mut rval = NullValue();
- unsafe {
- JS_CallFunctionValue(cx, this_value, *data.funval,
- 0, ptr::mut_null(), &mut rval);
- }
- });
-
- if !data.is_interval {
- window.deref().active_timers.deref().borrow_mut().remove(&timer_id);
- }
+ window.handle_fire_timer(timer_id, self.get_cx());
}
/// Handles a notification that reflow completed.