Subsume ScriptMsg::WorkerDispatchErrorEvent into ScriptMsg::RunnableMsg via introduction of Worker::WorkerErrorHandler (Closes #5171).

This commit is contained in:
Avi Weinstock 2015-03-09 09:24:40 -04:00
parent fbacd1a4c4
commit 7803f2b216
3 changed files with 30 additions and 13 deletions

View file

@ -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);
}
}