mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Subsume ScriptMsg::WorkerDispatchErrorEvent into ScriptMsg::RunnableMsg via introduction of Worker::WorkerErrorHandler (Closes #5171).
This commit is contained in:
parent
fbacd1a4c4
commit
7803f2b216
3 changed files with 30 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue