mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Split fn script_chan into 5 different task channel fn
This commit is contained in:
parent
368dd1dc53
commit
8d90034d29
11 changed files with 98 additions and 39 deletions
|
@ -75,7 +75,7 @@ impl Worker {
|
|||
|
||||
let (sender, receiver) = channel();
|
||||
let worker = Worker::new(global, sender.clone());
|
||||
let worker_ref = Trusted::new(global.get_cx(), worker.r(), global.script_chan());
|
||||
let worker_ref = Trusted::new(global.get_cx(), worker.r(), global.dom_manipulation_task_source());
|
||||
let worker_id = global.get_next_worker_id();
|
||||
|
||||
let (devtools_sender, devtools_receiver) = ipc::channel().unwrap();
|
||||
|
@ -106,7 +106,7 @@ impl Worker {
|
|||
};
|
||||
DedicatedWorkerGlobalScope::run_worker_scope(
|
||||
init, worker_url, global.pipeline(), devtools_receiver, worker_ref,
|
||||
global.script_chan(), sender, receiver);
|
||||
global.dom_manipulation_task_source(), sender, receiver);
|
||||
|
||||
Ok(worker)
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ impl WorkerMethods for Worker {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-dedicatedworkerglobalscope-postmessage
|
||||
fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
|
||||
let data = try!(StructuredCloneData::write(cx, message));
|
||||
let address = Trusted::new(cx, self, self.global.root().r().script_chan().clone());
|
||||
let address = Trusted::new(cx, self, self.global.root().r().dom_manipulation_task_source().clone());
|
||||
self.sender.send((address, WorkerScriptMsg::DOMMessage(data))).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue