Reintroduce parent runtimes for worker threads.

This commit is contained in:
Josh Matthews 2018-12-02 14:58:15 -05:00
parent 644101e1e4
commit 367014a4ea
7 changed files with 49 additions and 14 deletions

View file

@ -39,7 +39,7 @@ use ipc_channel::ipc::IpcSender;
use js::jsapi::{JSAutoCompartment, JSContext};
use js::jsval::UndefinedValue;
use js::panic::maybe_resume_unwind;
use js::rust::HandleValue;
use js::rust::{HandleValue, ParentRuntime};
use msg::constellation_msg::PipelineId;
use net_traits::request::{CredentialsMode, Destination, RequestInit as NetRequestInit};
use net_traits::{load_whole_resource, IpcSend};
@ -135,6 +135,10 @@ impl WorkerGlobalScope {
}
}
pub fn runtime_handle(&self) -> ParentRuntime {
self.runtime.prepare_for_new_child()
}
pub fn from_devtools_sender(&self) -> Option<IpcSender<DevtoolScriptControlMsg>> {
self.from_devtools_sender.clone()
}