mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Report panics in web worker threads.
This commit is contained in:
parent
aa8c835d3b
commit
1ebe681d8d
7 changed files with 42 additions and 12 deletions
|
@ -18,7 +18,7 @@ use ipc_channel::ipc::IpcSender;
|
|||
use js::jsapi::{CurrentGlobalOrNull, GetGlobalForObjectCrossCompartment};
|
||||
use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue};
|
||||
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
|
||||
use msg::constellation_msg::{ConstellationChan, PipelineId};
|
||||
use msg::constellation_msg::{ConstellationChan, PanicMsg, PipelineId};
|
||||
use net_traits::ResourceThread;
|
||||
use profile_traits::mem;
|
||||
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptPort};
|
||||
|
@ -263,6 +263,14 @@ impl<'a> GlobalRef<'a> {
|
|||
GlobalRef::Worker(ref worker) => worker.reflector(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns an `IpcSender` to report panics on.
|
||||
pub fn panic_chan(&self) -> &IpcSender<PanicMsg> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.panic_chan(),
|
||||
GlobalRef::Worker(ref worker) => worker.panic_chan(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GlobalRoot {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue