aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source
diff options
context:
space:
mode:
authorddh <dianehosfelt@gmail.com>2017-10-24 02:45:55 +0100
committerddh <dianehosfelt@gmail.com>2017-10-25 14:25:58 +0100
commit52b63def44b4819184d2badcc4d123b770a7878a (patch)
treee027a7ad1ab55ab27b71005f0472a38469998267 /components/script/task_source
parent2ffbe5398970e54ad55d3e53b495ee6651b64f4c (diff)
downloadservo-52b63def44b4819184d2badcc4d123b770a7878a.tar.gz
servo-52b63def44b4819184d2badcc4d123b770a7878a.zip
added pipelines to all task sources
changed task sources to accept pipeline ids
Diffstat (limited to 'components/script/task_source')
-rw-r--r--components/script/task_source/dom_manipulation.rs5
-rw-r--r--components/script/task_source/file_reading.rs7
-rw-r--r--components/script/task_source/networking.rs9
-rw-r--r--components/script/task_source/performance_timeline.rs7
-rw-r--r--components/script/task_source/user_interaction.rs5
5 files changed, 19 insertions, 14 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs
index 16db9310693..5b5e55570b4 100644
--- a/components/script/task_source/dom_manipulation.rs
+++ b/components/script/task_source/dom_manipulation.rs
@@ -7,6 +7,7 @@ use dom::bindings::refcounted::Trusted;
use dom::event::{EventBubbles, EventCancelable, EventTask, SimpleEventTask};
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 DOMManipulationTaskSource(pub Sender<MainThreadScriptMsg>);
+pub struct DOMManipulationTaskSource(pub Sender<MainThreadScriptMsg>, pub PipelineId);
impl fmt::Debug for DOMManipulationTaskSource {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -37,7 +38,7 @@ impl TaskSource for DOMManipulationTaskSource {
let msg = MainThreadScriptMsg::Common(CommonScriptMsg::Task(
ScriptThreadEventCategory::ScriptEvent,
Box::new(canceller.wrap_task(task)),
- None //TODO
+ Some(self.1)
));
self.0.send(msg).map_err(|_| ())
}
diff --git a/components/script/task_source/file_reading.rs b/components/script/task_source/file_reading.rs
index 8f4cdd80ac3..e94f957234c 100644
--- a/components/script/task_source/file_reading.rs
+++ b/components/script/task_source/file_reading.rs
@@ -4,17 +4,18 @@
use dom::domexception::DOMErrorName;
use dom::filereader::{FileReader, TrustedFileReader, GenerationId, ReadMetaData};
+use msg::constellation_msg::PipelineId;
use script_runtime::{CommonScriptMsg, ScriptThreadEventCategory, ScriptChan};
use std::sync::Arc;
use task::{TaskCanceller, TaskOnce};
use task_source::TaskSource;
#[derive(JSTraceable)]
-pub struct FileReadingTaskSource(pub Box<ScriptChan + Send + 'static>);
+pub struct FileReadingTaskSource(pub Box<ScriptChan + Send + 'static>, pub PipelineId);
impl Clone for FileReadingTaskSource {
fn clone(&self) -> FileReadingTaskSource {
- FileReadingTaskSource(self.0.clone())
+ FileReadingTaskSource(self.0.clone(), self.1.clone())
}
}
@@ -30,7 +31,7 @@ impl TaskSource for FileReadingTaskSource {
self.0.send(CommonScriptMsg::Task(
ScriptThreadEventCategory::FileRead,
Box::new(canceller.wrap_task(task)),
- None //TODO
+ Some(self.1),
))
}
}
diff --git a/components/script/task_source/networking.rs b/components/script/task_source/networking.rs
index 0c2fd8f6162..ed192d08003 100644
--- a/components/script/task_source/networking.rs
+++ b/components/script/task_source/networking.rs
@@ -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),
))
}
}
diff --git a/components/script/task_source/performance_timeline.rs b/components/script/task_source/performance_timeline.rs
index a91865cf02f..9f72305b00e 100644
--- a/components/script/task_source/performance_timeline.rs
+++ b/components/script/task_source/performance_timeline.rs
@@ -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(|_| ())
}
diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs
index ba90a26a080..12f822afedd 100644
--- a/components/script/task_source/user_interaction.rs
+++ b/components/script/task_source/user_interaction.rs
@@ -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(|_| ())
}