Split fn script_chan into 5 different task channel fn

This commit is contained in:
Keith Yeung 2015-12-05 14:17:22 -08:00
parent 368dd1dc53
commit 8d90034d29
11 changed files with 98 additions and 39 deletions

View file

@ -981,7 +981,7 @@ impl XMLHttpRequest {
// This will cancel all previous timeouts
let global = self.global.root();
let callback = ScheduledXHRTimeout {
xhr: Trusted::new(global.r().get_cx(), self, global.r().script_chan()),
xhr: Trusted::new(global.r().get_cx(), self, global.r().networking_task_source()),
generation_id: self.generation_id.get(),
};
let duration = Length::new(duration_ms as u64);
@ -1053,7 +1053,7 @@ impl XMLHttpRequest {
Ok(req) => req,
};
let xhr = Trusted::new(global.get_cx(), self, global.script_chan());
let xhr = Trusted::new(global.get_cx(), self, global.networking_task_source());
let context = Arc::new(Mutex::new(XHRContext {
xhr: xhr,
@ -1067,7 +1067,7 @@ impl XMLHttpRequest {
let (tx, rx) = global.new_script_pair();
(tx, Some(rx))
} else {
(global.script_chan(), None)
(global.networking_task_source(), None)
};
let resource_task = global.resource_task();