added pipelines to all task sources

changed task sources to accept pipeline ids
This commit is contained in:
ddh 2017-10-24 02:45:55 +01:00
parent 2ffbe53989
commit 52b63def44
20 changed files with 194 additions and 230 deletions

View file

@ -2,16 +2,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use msg::constellation_msg::PipelineId;
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use task::{TaskCanceller, TaskOnce};
use task_source::TaskSource;
#[derive(JSTraceable)]
pub struct NetworkingTaskSource(pub Box<ScriptChan + Send + 'static>);
pub struct NetworkingTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
impl Clone for NetworkingTaskSource {
fn clone(&self) -> NetworkingTaskSource {
NetworkingTaskSource(self.0.clone())
NetworkingTaskSource(self.0.clone(), self.1.clone())
}
}
@ -27,7 +28,7 @@ impl TaskSource for NetworkingTaskSource {
self.0.send(CommonScriptMsg::Task(
ScriptThreadEventCategory::NetworkEvent,
Box::new(canceller.wrap_task(task)),
None
Some(self.1),
))
}
}
@ -42,7 +43,7 @@ impl NetworkingTaskSource {
self.0.send(CommonScriptMsg::Task(
ScriptThreadEventCategory::NetworkEvent,
Box::new(task),
None //TODO
Some(self.1),
))
}
}