mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
script: Ensure JS engine is initialized and deinitialized on the same thread.
This commit is contained in:
parent
f1aa5d8dbd
commit
7944d9548c
5 changed files with 44 additions and 8 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
use crate::dom::bindings::codegen::RegisterBindings;
|
||||
use crate::dom::bindings::proxyhandler;
|
||||
use crate::script_runtime::JSEngineSetup;
|
||||
use crate::serviceworker_manager::ServiceWorkerManager;
|
||||
use script_traits::SWManagerSenders;
|
||||
|
||||
|
@ -56,7 +57,7 @@ pub fn init_service_workers(sw_senders: SWManagerSenders) {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn init() {
|
||||
pub fn init() -> JSEngineSetup {
|
||||
unsafe {
|
||||
proxyhandler::init();
|
||||
|
||||
|
@ -66,4 +67,6 @@ pub fn init() {
|
|||
}
|
||||
|
||||
perform_platform_specific_initialization();
|
||||
|
||||
JSEngineSetup::new()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue