Auto merge of #24842 - servo:jdm-patch-34, r=nox

Make JS runnables for workers execute on correct event loop

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24812
This commit is contained in:
bors-servo 2019-11-26 09:33:59 -05:00 committed by GitHub
commit 7a72f8a168
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 271 deletions

View file

@ -347,10 +347,14 @@ impl DedicatedWorkerGlobalScope {
let runtime = unsafe {
if let Some(pipeline_id) = pipeline_id {
new_child_runtime(
parent,
Some(NetworkingTaskSource(parent_sender.clone(), pipeline_id)),
)
let task_source = NetworkingTaskSource(
Box::new(WorkerThreadWorkerChan {
sender: own_sender.clone(),
worker: worker.clone(),
}),
pipeline_id,
);
new_child_runtime(parent, Some(task_source))
} else {
new_child_runtime(parent, None)
}