diff options
Diffstat (limited to 'components/script/lib.rs')
-rw-r--r-- | components/script/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/script/lib.rs b/components/script/lib.rs index 2744115aff1..78a84f83586 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -106,6 +106,7 @@ pub mod parse; pub mod script_runtime; #[allow(unsafe_code)] pub mod script_thread; +mod serviceworker_manager; mod task_source; pub mod textinput; mod timers; @@ -114,6 +115,8 @@ mod webdriver_handlers; use dom::bindings::codegen::RegisterBindings; use js::jsapi::{Handle, JSContext, JSObject, SetDOMProxyInformation}; +use script_traits::SWManagerSenders; +use serviceworker_manager::ServiceWorkerManager; use std::ptr; use util::opts; @@ -159,11 +162,14 @@ fn perform_platform_specific_initialization() { fn perform_platform_specific_initialization() {} #[allow(unsafe_code)] -pub fn init() { +pub fn init(sw_senders: SWManagerSenders) { unsafe { SetDOMProxyInformation(ptr::null(), 0, Some(script_thread::shadow_check_callback)); } + // 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(); |