aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/workerglobalscope.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-09-10 09:11:44 -0400
committerGitHub <noreply@github.com>2018-09-10 09:11:44 -0400
commit78ad1df0b008c782cc496bed45c5898c2ba545ac (patch)
tree55e338e5c074039ec9b2c63b883b34af50e4d833 /components/script/dom/workerglobalscope.rs
parent0341b87b8b7db066a14503ac97aac93ea3c68699 (diff)
parent5dd6e21c2e7e1c35a2a4a57812126e28a4b58599 (diff)
downloadservo-78ad1df0b008c782cc496bed45c5898c2ba545ac.tar.gz
servo-78ad1df0b008c782cc496bed45c5898c2ba545ac.zip
Auto merge of #21645 - AgustinCB:add-websocket-task-queue, r=jdm
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. Also, while working on this, I made a typo here: https://github.com/AgustinCB/servo/blob/5dd6e21c2e7e1c35a2a4a57812126e28a4b58599/components/script/dom/window.rs#L191 Setting the name incorrectly. The error, however, was this: ```bash error[E0412]: cannot find type `WebsocketEventTaskSource` in this scope --> components/script/dom/window.rs:171:1 | 171 | #[dom_struct] | ^^^^^^^^^^^^^ did you mean `WebsocketTaskSource`? ``` Which isn't useful at all. Not sure if it's a rustc problem or something related with htis code base, but I thought it was worth mentioning. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #21590 - [ ] There are tests for these changes OR - [x] These changes do not require tests because they don't include new behavior and existing tests should cover this code. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21645) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/workerglobalscope.rs')
-rw-r--r--components/script/dom/workerglobalscope.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/dom/workerglobalscope.rs b/components/script/dom/workerglobalscope.rs
index 9418b51759c..ac372c5fe98 100644
--- a/components/script/dom/workerglobalscope.rs
+++ b/components/script/dom/workerglobalscope.rs
@@ -47,6 +47,7 @@ use task_source::file_reading::FileReadingTaskSource;
use task_source::networking::NetworkingTaskSource;
use task_source::performance_timeline::PerformanceTimelineTaskSource;
use task_source::remote_event::RemoteEventTaskSource;
+use task_source::websocket::WebsocketTaskSource;
use time::precise_time_ns;
use timers::{IsInterval, TimerCallback};
@@ -386,6 +387,10 @@ impl WorkerGlobalScope {
RemoteEventTaskSource(self.script_chan(), self.pipeline_id())
}
+ pub fn websocket_task_source(&self) -> WebsocketTaskSource {
+ WebsocketTaskSource(self.script_chan(), self.pipeline_id())
+ }
+
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
let dedicated = self.downcast::<DedicatedWorkerGlobalScope>();
if let Some(dedicated) = dedicated {