diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-20 09:40:53 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-20 09:40:53 +0200 |
commit | f088b708c93e0a131cbfccf5c9b3797018f1c4ee (patch) | |
tree | d75727ac812624a7bee2b0bb827616af0540d99b /components/script/dom | |
parent | 8000efac75c96f87a5e242be84b246f98a1b61e5 (diff) | |
download | servo-f088b708c93e0a131cbfccf5c9b3797018f1c4ee.tar.gz servo-f088b708c93e0a131cbfccf5c9b3797018f1c4ee.zip |
Make Task require Send
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/bindings/refcounted.rs | 4 | ||||
-rw-r--r-- | components/script/dom/worklet.rs | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/bindings/refcounted.rs b/components/script/dom/bindings/refcounted.rs index cdf80264edb..b449a984356 100644 --- a/components/script/dom/bindings/refcounted.rs +++ b/components/script/dom/bindings/refcounted.rs @@ -122,7 +122,7 @@ impl TrustedPromise { /// A task which will reject the promise. #[allow(unrooted_must_root)] - pub fn reject_task(self, error: Error) -> impl Send + Task { + pub fn reject_task(self, error: Error) -> impl Task { let this = self; task!(reject_promise: move || { debug!("Rejecting promise."); @@ -135,7 +135,7 @@ impl TrustedPromise { /// A task which will resolve the promise. #[allow(unrooted_must_root)] - pub fn resolve_task<T>(self, value: T) -> impl Send + Task + pub fn resolve_task<T>(self, value: T) -> impl Task where T: ToJSValConvertible + Send, { diff --git a/components/script/dom/worklet.rs b/components/script/dom/worklet.rs index b55f9d328a0..e6d47d42f48 100644 --- a/components/script/dom/worklet.rs +++ b/components/script/dom/worklet.rs @@ -645,8 +645,9 @@ impl WorkletThread { } /// Run a task in the main script thread. - fn run_in_script_thread<T>(&self, task: T) where - T: 'static + Send + Task, + fn run_in_script_thread<T>(&self, task: T) + where + T: Task + 'static, { let msg = CommonScriptMsg::Task(ScriptThreadEventCategory::WorkletEvent, box task); let msg = MainThreadScriptMsg::Common(msg); |