mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Force all messages to worker tasks to send a TrustedWorkerAddress along with the ScriptMsg. This ensures that the main-thread Worker object is rooted for as long as there are events in flight or being processed.
This commit is contained in:
parent
2f059c15e7
commit
9a7cd31134
11 changed files with 234 additions and 121 deletions
|
@ -31,6 +31,7 @@ use dom::bindings::js::JS;
|
|||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::utils::{Reflectable, Reflector, WindowProxyHandler};
|
||||
use dom::node::{Node, TrustedNodeAddress};
|
||||
use script_task::ScriptChan;
|
||||
|
||||
use collections::hash::{Hash, Hasher};
|
||||
use cssparser::RGBA;
|
||||
|
@ -219,6 +220,13 @@ no_jsmanaged_fields!(UntrustedNodeAddress)
|
|||
no_jsmanaged_fields!(LengthOrPercentageOrAuto)
|
||||
no_jsmanaged_fields!(RGBA)
|
||||
|
||||
impl JSTraceable for Box<ScriptChan+Send> {
|
||||
#[inline]
|
||||
fn trace(&self, _trc: *mut JSTracer) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> JSTraceable for &'a str {
|
||||
#[inline]
|
||||
fn trace(&self, _: *mut JSTracer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue