aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/lib.rs
diff options
context:
space:
mode:
authorRahul Sharma <rsconceptx@gmail.com>2016-06-09 18:52:52 +0530
committerRahul Sharma <rsconceptx@gmail.com>2016-07-16 23:29:44 +0530
commit1e6293ea1d06120c9f3488d7d32c24d8d92df6b1 (patch)
treeffc6addc9aff4eeb5562fd1b3b588603532b38c4 /components/script/lib.rs
parente8fa02a07f3ee8965c022df4e92d5bdb0fccdb0b (diff)
downloadservo-1e6293ea1d06120c9f3488d7d32c24d8d92df6b1.tar.gz
servo-1e6293ea1d06120c9f3488d7d32c24d8d92df6b1.zip
Integrate service worker manager thread
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();