diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-07-10 08:23:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 08:23:34 -0400 |
commit | 8988d674d0cbea59eaaa8c80f36f29d214682a0b (patch) | |
tree | b661e8bbf9be062af35f5d1eb8eda80de7918dfd /components/script/dom/eventsource.rs | |
parent | 2bc70e738b01051a64f2183691e0abd9a0f84072 (diff) | |
parent | 671627e97e20ae4baf728ae6dda61ef6f857c193 (diff) | |
download | servo-8988d674d0cbea59eaaa8c80f36f29d214682a0b.tar.gz servo-8988d674d0cbea59eaaa8c80f36f29d214682a0b.zip |
Auto merge of #21126 - gterzian:tasksource_specific_cancelation, r=jdm
Introduce "per task source" cancellation
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #21119 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/21126)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/eventsource.rs')
-rw-r--r-- | components/script/dom/eventsource.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/eventsource.rs b/components/script/dom/eventsource.rs index 3f2b829a457..f0b5726e6a3 100644 --- a/components/script/dom/eventsource.rs +++ b/components/script/dom/eventsource.rs @@ -34,7 +34,7 @@ use std::cell::Cell; use std::mem; use std::str::{Chars, FromStr}; use std::sync::{Arc, Mutex}; -use task_source::TaskSource; +use task_source::{TaskSource, TaskSourceName}; use timers::OneshotTimerCallback; use utf8; @@ -482,10 +482,12 @@ impl EventSource { data: String::new(), last_event_id: String::new(), }; + // TODO: use the "remote event task source", and canceller. + // https://html.spec.whatwg.org/multipage/#remote-event-task-source let listener = NetworkListener { context: Arc::new(Mutex::new(context)), task_source: global.networking_task_source(), - canceller: Some(global.task_canceller()) + canceller: Some(global.task_canceller(TaskSourceName::Networking)) }; ROUTER.add_route(action_receiver.to_opaque(), Box::new(move |message| { listener.notify_fetch(message.to().unwrap()); |