Make first argument of DOMManipulationTaskSource as a Box<ScriptChan +

Send>

We don't have `window` for `workers`. So, if we use `global.as_window()`
to get the DOMManipulationTaskSource, it will make worker panic.
Instead, we should get the DOMManipulationTaskSource from each own
thread.

Ref: https://github.com/servo/servo/pull/20755#discussion_r193557746
This commit is contained in:
CYBAI 2018-06-10 21:02:11 +08:00
parent 924a78c6c6
commit 42903412c7
5 changed files with 32 additions and 11 deletions

View file

@ -217,7 +217,7 @@ pub fn notify_about_rejected_promises(global: &GlobalScope) {
let target = Trusted::new(global.upcast::<EventTarget>());
// Step 4.
global.as_window().dom_manipulation_task_source().queue(
global.dom_manipulation_task_source().queue(
task!(unhandled_rejection_event: move || {
let target = target.root();
let cx = target.global().get_cx();