diff options
author | Agustin Chiappe Berrini <jnieve@gmail.com> | 2018-09-08 17:01:27 -0400 |
---|---|---|
committer | Agustin Chiappe Berrini <jnieve@gmail.com> | 2018-09-08 17:01:27 -0400 |
commit | 5dd6e21c2e7e1c35a2a4a57812126e28a4b58599 (patch) | |
tree | 5c98fbf6599a4d3ea28f8f37f9c9d2cdd44b9610 /components/script/script_thread.rs | |
parent | f7630dad87da33449ce05b5e7a9ef6f747e9531d (diff) | |
download | servo-5dd6e21c2e7e1c35a2a4a57812126e28a4b58599.tar.gz servo-5dd6e21c2e7e1c35a2a4a57812126e28a4b58599.zip |
Add Websocket task source
According to the doc: https://html.spec.whatwg.org/multipage/web-sockets.html#network
The task source for all tasks queued in the websocket section are the
websocket task source, so this commit also updates those references to
use the appropriate one.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 090fc743a47..8f9d98a2e93 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -125,6 +125,7 @@ use task_source::networking::NetworkingTaskSource; use task_source::performance_timeline::PerformanceTimelineTaskSource; use task_source::remote_event::RemoteEventTaskSource; use task_source::user_interaction::UserInteractionTaskSource; +use task_source::websocket::WebsocketTaskSource; use time::{get_time, precise_time_ns, Tm}; use url::Position; use url::percent_encoding::percent_decode; @@ -1896,6 +1897,10 @@ impl ScriptThread { RemoteEventTaskSource(self.remote_event_task_sender.clone(), pipeline_id) } + pub fn websocket_task_source(&self, pipeline_id: PipelineId) -> WebsocketTaskSource { + WebsocketTaskSource(self.remote_event_task_sender.clone(), pipeline_id) + } + /// Handles a request for the window title. fn handle_get_title_msg(&self, pipeline_id: PipelineId) { let document = match { self.documents.borrow().find_document(pipeline_id) } { @@ -2220,6 +2225,7 @@ impl ScriptThread { self.file_reading_task_source(incomplete.pipeline_id), self.performance_timeline_task_source(incomplete.pipeline_id).clone(), self.remote_event_task_source(incomplete.pipeline_id), + self.websocket_task_source(incomplete.pipeline_id), self.image_cache_channel.clone(), self.image_cache.clone(), self.resource_threads.clone(), |