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

@ -8,6 +8,7 @@
use dom::bindings::refcounted::Trusted;
use dom::globalscope::GlobalScope;
use msg::constellation_msg::PipelineId;
use script_runtime::{CommonScriptMsg, ScriptChan, ScriptThreadEventCategory};
use std::fmt;
use std::result::Result;
@ -15,11 +16,11 @@ use task::{TaskCanceller, TaskOnce};
use task_source::TaskSource;
#[derive(JSTraceable)]
pub struct PerformanceTimelineTaskSource(pub Box<ScriptChan + Send + 'static>);
pub struct PerformanceTimelineTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
impl Clone for PerformanceTimelineTaskSource {
fn clone(&self) -> PerformanceTimelineTaskSource {
PerformanceTimelineTaskSource(self.0.clone())
PerformanceTimelineTaskSource(self.0.clone(), self.1.clone())
}
}
@ -41,7 +42,7 @@ impl TaskSource for PerformanceTimelineTaskSource {
let msg = CommonScriptMsg::Task(
ScriptThreadEventCategory::PerformanceTimelineTask,
Box::new(canceller.wrap_task(task)),
None
Some(self.1)
);
self.0.send(msg).map_err(|_| ())
}