Bind runnable dispatching in script_runtime

This commit is contained in:
Akash-Pateria 2019-11-16 22:42:43 -05:00 committed by Josh Matthews
parent e6ae93f66e
commit 84f16eae98
69 changed files with 164 additions and 427 deletions

View file

@ -1244,7 +1244,12 @@ impl ScriptThread {
replace_surrogates: bool,
user_agent: Cow<'static, str>,
) -> ScriptThread {
let runtime = new_rt_and_cx();
let boxed_script_sender = Box::new(MainThreadScriptChan(chan.clone()));
let runtime = new_rt_and_cx(Some(NetworkingTaskSource(
boxed_script_sender.clone(),
state.id,
)));
let cx = runtime.cx();
unsafe {
@ -1262,8 +1267,6 @@ impl ScriptThread {
// Ask the router to proxy IPC messages from the control port to us.
let control_port = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(state.control_port);
let boxed_script_sender = Box::new(MainThreadScriptChan(chan.clone()));
let (image_cache_channel, image_cache_port) = unbounded();
let task_queue = TaskQueue::new(port, chan.clone());