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

@ -7,6 +7,7 @@ use dom::bindings::refcounted::Trusted;
use dom::event::{EventBubbles, EventCancelable, EventTask};
use dom::eventtarget::EventTarget;
use dom::window::Window;
use msg::constellation_msg::PipelineId;
use script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
use script_thread::MainThreadScriptMsg;
use servo_atoms::Atom;
@ -17,7 +18,7 @@ use task::{TaskCanceller, TaskOnce};
use task_source::TaskSource;
#[derive(Clone, JSTraceable)]
pub struct UserInteractionTaskSource(pub Sender<MainThreadScriptMsg>);
pub struct UserInteractionTaskSource(pub Sender<MainThreadScriptMsg>, pub PipelineId);
impl fmt::Debug for UserInteractionTaskSource {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@ -37,7 +38,7 @@ impl TaskSource for UserInteractionTaskSource {
let msg = MainThreadScriptMsg::Common(CommonScriptMsg::Task(
ScriptThreadEventCategory::InputEvent,
Box::new(canceller.wrap_task(task)),
None
Some(self.1)
));
self.0.send(msg).map_err(|_| ())
}