aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/globalscope.rs
diff options
context:
space:
mode:
authorGregory Terzian <gterzian@users.noreply.github.com>2018-07-05 12:33:09 +0800
committerGregory Terzian <gterzian@users.noreply.github.com>2018-07-10 13:42:28 +0800
commit671627e97e20ae4baf728ae6dda61ef6f857c193 (patch)
treec86d1e568b551613bde1b61bf3db3dee42735a79 /components/script/dom/globalscope.rs
parentce430566cdbccaa86ec498aa48392eab3ec69256 (diff)
downloadservo-671627e97e20ae4baf728ae6dda61ef6f857c193.tar.gz
servo-671627e97e20ae4baf728ae6dda61ef6f857c193.zip
introduce "per task source" ignoring of tasks
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!();