aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/worker.rs
diff options
context:
space:
mode:
authorAvi Weinstock <aweinstock314@gmail.com>2015-03-09 09:24:40 -0400
committerAvi Weinstock <aweinstock314@gmail.com>2015-03-09 09:24:40 -0400
commit7803f2b216f736ac703e55010bfbd70e4dfc0cad (patch)
treeaa1cc133862e7e539ea5bd2e33e33d94632c40be /components/script/dom/worker.rs
parentfbacd1a4c42c104d679de1a04fea4ddd41e1ca44 (diff)
downloadservo-7803f2b216f736ac703e55010bfbd70e4dfc0cad.tar.gz
servo-7803f2b216f736ac703e55010bfbd70e4dfc0cad.zip
Subsume ScriptMsg::WorkerDispatchErrorEvent into ScriptMsg::RunnableMsg via introduction of Worker::WorkerErrorHandler (Closes #5171).
Diffstat (limited to 'components/script/dom/worker.rs')
-rw-r--r--components/script/dom/worker.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 4ab21e1db52..d764fff259e 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -165,3 +165,30 @@ impl Runnable for WorkerEventHandler {
Worker::dispatch_simple_error(this.addr);
}
}
+
+pub struct WorkerErrorHandler {
+ addr: TrustedWorkerAddress,
+ msg: DOMString,
+ file_name: DOMString,
+ line_num: u32,
+ col_num: u32,
+}
+
+impl WorkerErrorHandler {
+ pub fn new(addr: TrustedWorkerAddress, msg: DOMString, file_name: DOMString, line_num: u32, col_num: u32) -> WorkerErrorHandler {
+ WorkerErrorHandler {
+ addr: addr,
+ msg: msg,
+ file_name: file_name,
+ line_num: line_num,
+ col_num: col_num,
+ }
+ }
+}
+
+impl Runnable for WorkerErrorHandler {
+ fn handler(self: Box<WorkerErrorHandler>) {
+ let this = *self;
+ Worker::handle_error_message(this.addr, this.msg, this.file_name, this.line_num, this.col_num);
+ }
+}