mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #14179 - emilio:racy-script, r=jdm
script: Ensure script is initialized before running script. <!-- Please describe your changes on the following line: --> Fixes the race causing #14154. Service workers are ok because they contain explicit synchronization. r? @asajeffrey or @jdm <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14179) <!-- Reviewable:end -->
This commit is contained in:
commit
6911a2f652
2 changed files with 13 additions and 6 deletions
|
@ -163,15 +163,17 @@ fn perform_platform_specific_initialization() {
|
|||
#[cfg(not(target_os = "linux"))]
|
||||
fn perform_platform_specific_initialization() {}
|
||||
|
||||
pub fn init_service_workers(sw_senders: SWManagerSenders) {
|
||||
// Spawn the service worker manager passing the constellation sender
|
||||
ServiceWorkerManager::spawn_manager(sw_senders);
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn init(sw_senders: SWManagerSenders) {
|
||||
pub fn init() {
|
||||
unsafe {
|
||||
proxyhandler::init();
|
||||
}
|
||||
|
||||
// Spawn the service worker manager passing the constellation sender
|
||||
ServiceWorkerManager::spawn_manager(sw_senders);
|
||||
|
||||
// Create the global vtables used by the (generated) DOM
|
||||
// bindings to implement JS proxies.
|
||||
RegisterBindings::RegisterProxyHandlers();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue