aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/task_source')
-rw-r--r--components/script/task_source/dom_manipulation.rs20
-rw-r--r--components/script/task_source/file_reading.rs22
-rw-r--r--components/script/task_source/history_traversal.rs4
-rw-r--r--components/script/task_source/mod.rs7
-rw-r--r--components/script/task_source/networking.rs6
-rw-r--r--components/script/task_source/performance_timeline.rs6
-rw-r--r--components/script/task_source/remote_event.rs6
-rw-r--r--components/script/task_source/user_interaction.rs27
-rw-r--r--components/script/task_source/websocket.rs6
9 files changed, 41 insertions, 63 deletions
diff --git a/components/script/task_source/dom_manipulation.rs b/components/script/task_source/dom_manipulation.rs
index e72110479de..ad01f514e95 100644
--- a/components/script/task_source/dom_manipulation.rs
+++ b/components/script/task_source/dom_manipulation.rs
@@ -29,11 +29,7 @@ impl fmt::Debug for DOMManipulationTaskSource {
impl TaskSource for DOMManipulationTaskSource {
const NAME: TaskSourceName = TaskSourceName::DOMManipulation;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{
@@ -48,12 +44,14 @@ impl TaskSource for DOMManipulationTaskSource {
}
impl DOMManipulationTaskSource {
- pub fn queue_event(&self,
- target: &EventTarget,
- name: Atom,
- bubbles: EventBubbles,
- cancelable: EventCancelable,
- window: &Window) {
+ pub fn queue_event(
+ &self,
+ target: &EventTarget,
+ name: Atom,
+ bubbles: EventBubbles,
+ cancelable: EventCancelable,
+ window: &Window,
+ ) {
let target = Trusted::new(target);
let task = EventTask {
target: target,
diff --git a/components/script/task_source/file_reading.rs b/components/script/task_source/file_reading.rs
index f8ca38a0c30..6c6324c79e0 100644
--- a/components/script/task_source/file_reading.rs
+++ b/components/script/task_source/file_reading.rs
@@ -22,11 +22,7 @@ impl Clone for FileReadingTaskSource {
impl TaskSource for FileReadingTaskSource {
const NAME: TaskSourceName = TaskSourceName::FileReading;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{
@@ -58,14 +54,14 @@ impl FileReadingTask {
use self::FileReadingTask::*;
match self {
- ProcessRead(reader, gen_id) =>
- FileReader::process_read(reader, gen_id),
- ProcessReadData(reader, gen_id) =>
- FileReader::process_read_data(reader, gen_id),
- ProcessReadError(reader, gen_id, error) =>
- FileReader::process_read_error(reader, gen_id, error),
- ProcessReadEOF(reader, gen_id, metadata, blob_contents) =>
- FileReader::process_read_eof(reader, gen_id, metadata, blob_contents),
+ ProcessRead(reader, gen_id) => FileReader::process_read(reader, gen_id),
+ ProcessReadData(reader, gen_id) => FileReader::process_read_data(reader, gen_id),
+ ProcessReadError(reader, gen_id, error) => {
+ FileReader::process_read_error(reader, gen_id, error)
+ },
+ ProcessReadEOF(reader, gen_id, metadata, blob_contents) => {
+ FileReader::process_read_eof(reader, gen_id, metadata, blob_contents)
+ },
}
}
}
diff --git a/components/script/task_source/history_traversal.rs b/components/script/task_source/history_traversal.rs
index 7f44ba368b5..dfd97bf23e7 100644
--- a/components/script/task_source/history_traversal.rs
+++ b/components/script/task_source/history_traversal.rs
@@ -11,7 +11,9 @@ pub struct HistoryTraversalTaskSource(pub Sender<MainThreadScriptMsg>);
impl ScriptChan for HistoryTraversalTaskSource {
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
- self.0.send(MainThreadScriptMsg::Common(msg)).map_err(|_| ())
+ self.0
+ .send(MainThreadScriptMsg::Common(msg))
+ .map_err(|_| ())
}
fn clone(&self) -> Box<ScriptChan + Send> {
diff --git a/components/script/task_source/mod.rs b/components/script/task_source/mod.rs
index 4dbf0a61c37..a38607bfe98 100644
--- a/components/script/task_source/mod.rs
+++ b/components/script/task_source/mod.rs
@@ -2,7 +2,6 @@
* 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/. */
-
pub mod dom_manipulation;
pub mod file_reading;
pub mod history_traversal;
@@ -42,11 +41,7 @@ impl TaskSourceName {
pub trait TaskSource {
const NAME: TaskSourceName;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static;
diff --git a/components/script/task_source/networking.rs b/components/script/task_source/networking.rs
index 9ecbea9c80d..08429c4e029 100644
--- a/components/script/task_source/networking.rs
+++ b/components/script/task_source/networking.rs
@@ -19,11 +19,7 @@ impl Clone for NetworkingTaskSource {
impl TaskSource for NetworkingTaskSource {
const NAME: TaskSourceName = TaskSourceName::Networking;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{
diff --git a/components/script/task_source/performance_timeline.rs b/components/script/task_source/performance_timeline.rs
index 6191db7600a..645338554f0 100644
--- a/components/script/task_source/performance_timeline.rs
+++ b/components/script/task_source/performance_timeline.rs
@@ -33,11 +33,7 @@ impl fmt::Debug for PerformanceTimelineTaskSource {
impl TaskSource for PerformanceTimelineTaskSource {
const NAME: TaskSourceName = TaskSourceName::PerformanceTimeline;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{
diff --git a/components/script/task_source/remote_event.rs b/components/script/task_source/remote_event.rs
index 97e33977e6f..0e02551b034 100644
--- a/components/script/task_source/remote_event.rs
+++ b/components/script/task_source/remote_event.rs
@@ -19,11 +19,7 @@ impl Clone for RemoteEventTaskSource {
impl TaskSource for RemoteEventTaskSource {
const NAME: TaskSourceName = TaskSourceName::RemoteEvent;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{
diff --git a/components/script/task_source/user_interaction.rs b/components/script/task_source/user_interaction.rs
index d30d54829b5..18b86cf5a24 100644
--- a/components/script/task_source/user_interaction.rs
+++ b/components/script/task_source/user_interaction.rs
@@ -29,11 +29,7 @@ impl fmt::Debug for UserInteractionTaskSource {
impl TaskSource for UserInteractionTaskSource {
const NAME: TaskSourceName = TaskSourceName::UserInteraction;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{
@@ -48,14 +44,21 @@ impl TaskSource for UserInteractionTaskSource {
}
impl UserInteractionTaskSource {
- pub fn queue_event(&self,
- target: &EventTarget,
- name: Atom,
- bubbles: EventBubbles,
- cancelable: EventCancelable,
- window: &Window) {
+ pub fn queue_event(
+ &self,
+ target: &EventTarget,
+ name: Atom,
+ bubbles: EventBubbles,
+ cancelable: EventCancelable,
+ window: &Window,
+ ) {
let target = Trusted::new(target);
- let task = EventTask { target, name, bubbles, cancelable };
+ let task = EventTask {
+ target,
+ name,
+ bubbles,
+ cancelable,
+ };
let _ = self.queue(task, window.upcast());
}
}
diff --git a/components/script/task_source/websocket.rs b/components/script/task_source/websocket.rs
index fbf28aeeb92..9fb1ade2b01 100644
--- a/components/script/task_source/websocket.rs
+++ b/components/script/task_source/websocket.rs
@@ -19,11 +19,7 @@ impl Clone for WebsocketTaskSource {
impl TaskSource for WebsocketTaskSource {
const NAME: TaskSourceName = TaskSourceName::Websocket;
- fn queue_with_canceller<T>(
- &self,
- task: T,
- canceller: &TaskCanceller,
- ) -> Result<(), ()>
+ fn queue_with_canceller<T>(&self, task: T, canceller: &TaskCanceller) -> Result<(), ()>
where
T: TaskOnce + 'static,
{