aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/lib.rs')
-rw-r--r--components/script/lib.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/components/script/lib.rs b/components/script/lib.rs
index 2744115aff1..604e3770176 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;
@@ -113,7 +114,10 @@ mod unpremultiplytable;
mod webdriver_handlers;
use dom::bindings::codegen::RegisterBindings;
+use ipc_channel::ipc::IpcSender;
use js::jsapi::{Handle, JSContext, JSObject, SetDOMProxyInformation};
+use script_traits::SWManagerMsg;
+use serviceworker_manager::ServiceWorkerManager;
use std::ptr;
use util::opts;
@@ -159,11 +163,14 @@ fn perform_platform_specific_initialization() {
fn perform_platform_specific_initialization() {}
#[allow(unsafe_code)]
-pub fn init() {
+pub fn init(from_swmanager_sender: IpcSender<SWManagerMsg>) {
unsafe {
SetDOMProxyInformation(ptr::null(), 0, Some(script_thread::shadow_check_callback));
}
+ // Spawn the service worker manager passing the constellation sender
+ ServiceWorkerManager::spawn_manager(from_swmanager_sender);
+
// Create the global vtables used by the (generated) DOM
// bindings to implement JS proxies.
RegisterBindings::RegisterProxyHandlers();