aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/globalscope.rs')
-rw-r--r--components/script/dom/globalscope.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs
index cec59c92510..759216df27a 100644
--- a/components/script/dom/globalscope.rs
+++ b/components/script/dom/globalscope.rs
@@ -52,6 +52,7 @@ use std::rc::Rc;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use task::TaskCanceller;
+use task_source::TaskSourceName;
use task_source::file_reading::FileReadingTaskSource;
use task_source::networking::NetworkingTaskSource;
use task_source::performance_timeline::PerformanceTimelineTaskSource;
@@ -508,11 +509,14 @@ impl GlobalScope {
/// Returns the task canceller of this global to ensure that everything is
/// properly cancelled when the global scope is destroyed.
- pub fn task_canceller(&self) -> TaskCanceller {
+ pub fn task_canceller(&self, name: TaskSourceName) -> TaskCanceller {
if let Some(window) = self.downcast::<Window>() {
- return window.task_canceller();
+ return window.task_canceller(name);
}
if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
+ // Note: the "name" is not passed to the worker,
+ // because 'closing' it only requires one task canceller for all task sources.
+ // https://html.spec.whatwg.org/multipage/#dom-workerglobalscope-closing
return worker.task_canceller();
}
unreachable!();