diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-20 09:40:53 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-20 09:40:53 +0200 |
commit | f088b708c93e0a131cbfccf5c9b3797018f1c4ee (patch) | |
tree | d75727ac812624a7bee2b0bb827616af0540d99b /components/script/task_source | |
parent | 8000efac75c96f87a5e242be84b246f98a1b61e5 (diff) | |
download | servo-f088b708c93e0a131cbfccf5c9b3797018f1c4ee.tar.gz servo-f088b708c93e0a131cbfccf5c9b3797018f1c4ee.zip |
Make Task require Send
Diffstat (limited to 'components/script/task_source')
-rw-r--r-- | components/script/task_source/dom_manipulation.rs | 2 | ||||
-rw-r--r-- | components/script/task_source/file_reading.rs | 2 | ||||
-rw-r--r-- | components/script/task_source/mod.rs | 7 | ||||
-rw-r--r-- | components/script/task_source/networking.rs | 4 | ||||
-rw-r--r-- | components/script/task_source/performance_timeline.rs | 2 | ||||
-rw-r--r-- | components/script/task_source/user_interaction.rs | 2 |
6 files changed, 11 insertions, 8 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs index 93cdfde95f4..4062b5b1495 100644 --- a/components/script/task_source/dom_manipulation.rs +++ b/components/script/task_source/dom_manipulation.rs @@ -32,7 +32,7 @@ impl TaskSource for DOMManipulationTaskSource { canceller: &TaskCanceller, ) -> Result<(), ()> where - T: Task + Send + 'static, + T: Task + 'static, { let msg = MainThreadScriptMsg::Common(CommonScriptMsg::Task( ScriptThreadEventCategory::ScriptEvent, diff --git a/components/script/task_source/file_reading.rs b/components/script/task_source/file_reading.rs index 1d44a4087d6..111f07ddba1 100644 --- a/components/script/task_source/file_reading.rs +++ b/components/script/task_source/file_reading.rs @@ -25,7 +25,7 @@ impl TaskSource for FileReadingTaskSource { canceller: &TaskCanceller, ) -> Result<(), ()> where - T: Send + Task + 'static, + T: Task + 'static, { self.0.send(CommonScriptMsg::Task( ScriptThreadEventCategory::FileRead, diff --git a/components/script/task_source/mod.rs b/components/script/task_source/mod.rs index 40b3c2f3261..3c6139b6df3 100644 --- a/components/script/task_source/mod.rs +++ b/components/script/task_source/mod.rs @@ -20,9 +20,12 @@ pub trait TaskSource { canceller: &TaskCanceller, ) -> Result<(), ()> where - T: Send + Task + 'static; + T: Task + 'static; - fn queue<T: Task + Send + 'static>(&self, msg: Box<T>, global: &GlobalScope) -> Result<(), ()> { + fn queue<T>(&self, msg: Box<T>, global: &GlobalScope) -> Result<(), ()> + where + T: Task + 'static, + { self.queue_with_canceller(msg, &global.task_canceller()) } } diff --git a/components/script/task_source/networking.rs b/components/script/task_source/networking.rs index 5d339037729..57dabbbfd39 100644 --- a/components/script/task_source/networking.rs +++ b/components/script/task_source/networking.rs @@ -22,7 +22,7 @@ impl TaskSource for NetworkingTaskSource { canceller: &TaskCanceller, ) -> Result<(), ()> where - T: Send + Task + 'static, + T: Task + 'static, { self.0.send(CommonScriptMsg::Task( ScriptThreadEventCategory::NetworkEvent, @@ -36,7 +36,7 @@ impl NetworkingTaskSource { /// global scope gets destroyed. pub fn queue_unconditionally<T>(&self, msg: Box<T>) -> Result<(), ()> where - T: Task + Send + 'static, + T: Task + 'static, { self.0.send(CommonScriptMsg::Task(ScriptThreadEventCategory::NetworkEvent, msg)) } diff --git a/components/script/task_source/performance_timeline.rs b/components/script/task_source/performance_timeline.rs index 0b379d496f4..0bac66270f6 100644 --- a/components/script/task_source/performance_timeline.rs +++ b/components/script/task_source/performance_timeline.rs @@ -36,7 +36,7 @@ impl TaskSource for PerformanceTimelineTaskSource { canceller: &TaskCanceller, ) -> Result<(), ()> where - T: Send + Task + 'static, + T: Task + 'static, { let msg = CommonScriptMsg::Task( ScriptThreadEventCategory::PerformanceTimelineTask, diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs index 8b36a61e9d0..76321e0fa10 100644 --- a/components/script/task_source/user_interaction.rs +++ b/components/script/task_source/user_interaction.rs @@ -32,7 +32,7 @@ impl TaskSource for UserInteractionTaskSource { canceller: &TaskCanceller, ) -> Result<(), ()> where - T: Task + Send + 'static, + T: Task + 'static, { let msg = MainThreadScriptMsg::Common(CommonScriptMsg::Task( ScriptThreadEventCategory::InputEvent, |