aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-07-14 13:05:01 -0400
committerJosh Matthews <josh@joshmatthews.net>2016-07-14 13:27:41 -0400
commit2aef518ce672b8037913fb1a33980475e02259f8 (patch)
treee0d1a1286ce653115c661867ad286ece6a138b43 /components/script/dom
parent0e4865ea1ada7294d89581704f047b521f985c69 (diff)
downloadservo-2aef518ce672b8037913fb1a33980475e02259f8.tar.gz
servo-2aef518ce672b8037913fb1a33980475e02259f8.zip
Make task queue API usable from non-main threads.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/htmldetailselement.rs3
-rw-r--r--components/script/dom/htmlformelement.rs3
-rw-r--r--components/script/dom/htmlimageelement.rs2
-rw-r--r--components/script/dom/htmlmediaelement.rs9
-rw-r--r--components/script/dom/storage.rs3
5 files changed, 12 insertions, 8 deletions
diff --git a/components/script/dom/htmldetailselement.rs b/components/script/dom/htmldetailselement.rs
index 734ab8d0749..3c86a9fd0d9 100644
--- a/components/script/dom/htmldetailselement.rs
+++ b/components/script/dom/htmldetailselement.rs
@@ -5,6 +5,7 @@
use dom::attr::Attr;
use dom::bindings::codegen::Bindings::HTMLDetailsElementBinding;
use dom::bindings::codegen::Bindings::HTMLDetailsElementBinding::HTMLDetailsElementMethods;
+use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
use dom::bindings::js::Root;
use dom::bindings::refcounted::Trusted;
@@ -78,7 +79,7 @@ impl VirtualMethods for HTMLDetailsElement {
element: details,
toggle_number: counter
};
- let _ = task_source.queue(runnable, window.r());
+ let _ = task_source.queue(runnable, GlobalRef::Window(&window));
}
}
}
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 903722d0cf4..9d7ce208ee2 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -12,6 +12,7 @@ use dom::bindings::codegen::Bindings::HTMLFormElementBinding::HTMLFormElementMet
use dom::bindings::codegen::Bindings::HTMLInputElementBinding::HTMLInputElementMethods;
use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods;
use dom::bindings::conversions::DerivedFrom;
+use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, NodeTypeId};
use dom::bindings::js::{JS, MutNullableHeap, Root};
use dom::bindings::refcounted::Trusted;
@@ -484,7 +485,7 @@ impl HTMLFormElement {
};
// Step 3
- window.dom_manipulation_task_source().queue(nav, window).unwrap();
+ window.dom_manipulation_task_source().queue(nav, GlobalRef::Window(window)).unwrap();
}
/// Interactively validate the constraints of form elements
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 6671ca5bf55..cb0f65d0b2b 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -184,7 +184,7 @@ impl HTMLImageElement {
src: src.into(),
};
let task = window.dom_manipulation_task_source();
- let _ = task.queue(runnable, window);
+ let _ = task.queue(runnable, GlobalRef::Window(window));
}
}
}
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index b95244f02bf..9a4c394649a 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -241,7 +241,7 @@ impl HTMLMediaElement {
elem: Trusted::new(self),
};
let win = window_from_node(self);
- let _ = win.dom_manipulation_task_source().queue(task, win.r());
+ let _ = win.dom_manipulation_task_source().queue(task, GlobalRef::Window(&win));
}
// https://html.spec.whatwg.org/multipage/#internal-pause-steps step 2.2
@@ -265,13 +265,13 @@ impl HTMLMediaElement {
elem: Trusted::new(self),
};
let win = window_from_node(self);
- let _ = win.dom_manipulation_task_source().queue(task, win.r());
+ let _ = win.dom_manipulation_task_source().queue(task, GlobalRef::Window(&win));
}
fn queue_fire_simple_event(&self, type_: &'static str) {
let win = window_from_node(self);
let task = box FireSimpleEventTask::new(self, type_);
- let _ = win.dom_manipulation_task_source().queue(task, win.r());
+ let _ = win.dom_manipulation_task_source().queue(task, GlobalRef::Window(&win));
}
fn fire_simple_event(&self, type_: &str) {
@@ -498,7 +498,8 @@ impl HTMLMediaElement {
fn queue_dedicated_media_source_failure_steps(&self) {
let window = window_from_node(self);
- let _ = window.dom_manipulation_task_source().queue(box DedicatedMediaSourceFailureTask::new(self), window.r());
+ let _ = window.dom_manipulation_task_source().queue(box DedicatedMediaSourceFailureTask::new(self),
+ GlobalRef::Window(&window));
}
// https://html.spec.whatwg.org/multipage/#dedicated-media-source-failure-steps
diff --git a/components/script/dom/storage.rs b/components/script/dom/storage.rs
index 11dfc3ab5d2..d6d1e1968f8 100644
--- a/components/script/dom/storage.rs
+++ b/components/script/dom/storage.rs
@@ -161,7 +161,8 @@ impl Storage {
let window = global_ref.as_window();
let task_source = window.dom_manipulation_task_source();
let trusted_storage = Trusted::new(self);
- task_source.queue(box StorageEventRunnable::new(trusted_storage, key, old_value, new_value), window).unwrap();
+ task_source.queue(box StorageEventRunnable::new(trusted_storage, key, old_value, new_value),
+ global_ref).unwrap();
}
}