mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add a JSTraceable bound on ScriptChan
This commit is contained in:
parent
620a67ff14
commit
58919f17a6
3 changed files with 5 additions and 12 deletions
|
@ -5,6 +5,7 @@
|
|||
use dom::abstractworker::WorkerScriptMsg;
|
||||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::reflector::Reflectable;
|
||||
use dom::bindings::trace::JSTraceable;
|
||||
use script_runtime::{ScriptChan, CommonScriptMsg, ScriptPort};
|
||||
use std::sync::mpsc::{Receiver, Sender};
|
||||
|
||||
|
@ -17,7 +18,7 @@ pub struct SendableWorkerScriptChan<T: Reflectable> {
|
|||
pub worker: Trusted<T>,
|
||||
}
|
||||
|
||||
impl<T: Reflectable + 'static> ScriptChan for SendableWorkerScriptChan<T> {
|
||||
impl<T: JSTraceable + Reflectable + 'static> ScriptChan for SendableWorkerScriptChan<T> {
|
||||
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
|
||||
self.sender.send((self.worker.clone(), msg)).map_err(|_| ())
|
||||
}
|
||||
|
@ -39,7 +40,7 @@ pub struct WorkerThreadWorkerChan<T: Reflectable> {
|
|||
pub worker: Trusted<T>,
|
||||
}
|
||||
|
||||
impl<T: Reflectable + 'static> ScriptChan for WorkerThreadWorkerChan<T> {
|
||||
impl<T: JSTraceable + Reflectable + 'static> ScriptChan for WorkerThreadWorkerChan<T> {
|
||||
fn send(&self, msg: CommonScriptMsg) -> Result<(), ()> {
|
||||
self.sender
|
||||
.send((self.worker.clone(), WorkerScriptMsg::Common(msg)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue