mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -10,7 +10,7 @@
|
|||
use dom::bindings::conversions::FromJSValConvertible;
|
||||
use dom::bindings::js::{JS, JSRef, Root};
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::workerglobalscope::WorkerGlobalScope;
|
||||
use dom::workerglobalscope::{WorkerGlobalScope, WorkerGlobalScopeHelpers};
|
||||
use dom::window;
|
||||
use script_task::ScriptChan;
|
||||
|
||||
|
@ -81,7 +81,7 @@ impl<'a> GlobalRef<'a> {
|
|||
|
||||
/// `ScriptChan` used to send messages to the event loop of this global's
|
||||
/// thread.
|
||||
pub fn script_chan<'b>(&'b self) -> &'b ScriptChan {
|
||||
pub fn script_chan(&self) -> Box<ScriptChan+Send> {
|
||||
match *self {
|
||||
GlobalRef::Window(ref window) => window.script_chan(),
|
||||
GlobalRef::Worker(ref worker) => worker.script_chan(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue