aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_task.rs
diff options
context:
space:
mode:
authorShreya Bastikar <shreyabastikar@gmail.com>2015-02-05 21:42:10 +0000
committerJosh Matthews <josh@joshmatthews.net>2015-02-05 21:42:10 +0000
commit7309f2a4283a1e3afd1becec94a325b3bc1ec5ea (patch)
treeaae0b6ba74dc9a13b5a9b03c562e495883fac176 /components/script/script_task.rs
parent5c02f8956d37d39f4482c570621ffa1c61a3f41c (diff)
downloadservo-7309f2a4283a1e3afd1becec94a325b3bc1ec5ea.tar.gz
servo-7309f2a4283a1e3afd1becec94a325b3bc1ec5ea.zip
Support firing error events from a dedicated worker at the containing worker object.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r--components/script/script_task.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 50dc0538e0d..6c06d33f99d 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -32,6 +32,7 @@ use dom::keyboardevent::KeyboardEvent;
use dom::mouseevent::MouseEvent;
use dom::node::{self, Node, NodeHelpers, NodeDamage, NodeTypeId};
use dom::window::{Window, WindowHelpers, ScriptHelpers};
+use dom::worker::{Worker, TrustedWorkerAddress};
use parse::html::{HTMLInput, parse_html};
use layout_interface::{ScriptLayoutChan, LayoutChan, ReflowGoal, ReflowQueryType};
use layout_interface;
@@ -63,6 +64,7 @@ use servo_net::resource_task::LoadData as NetLoadData;
use servo_net::storage_task::StorageTask;
use util::geometry::to_frac_px;
use util::smallvec::SmallVec;
+use util::str::DOMString;
use util::task::spawn_named_with_send_on_failure;
use util::task_state;
@@ -123,6 +125,8 @@ pub enum ScriptMsg {
/// Message sent through Worker.postMessage (only dispatched to
/// DedicatedWorkerGlobalScope).
DOMMessage(StructuredCloneData),
+ /// Sends a message to the Worker object (dispatched to all tasks) regarding error.
+ WorkerDispatchErrorEvent(TrustedWorkerAddress, DOMString, DOMString, u32, u32),
/// Generic message that encapsulates event handling.
RunnableMsg(Box<Runnable+Send>),
/// A DOM object's last pinned reference was removed (dispatched to all tasks).
@@ -616,6 +620,8 @@ impl ScriptTask {
self.handle_exit_window_msg(id),
ScriptMsg::DOMMessage(..) =>
panic!("unexpected message"),
+ ScriptMsg::WorkerDispatchErrorEvent(addr, msg, file_name,line_num, col_num) =>
+ Worker::handle_error_message(addr, msg, file_name, line_num, col_num),
ScriptMsg::RunnableMsg(runnable) =>
runnable.handler(),
ScriptMsg::RefcountCleanup(addr) =>