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.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/components/script/lib.rs b/components/script/lib.rs
index ebc5b4a1686..5b16377fe68 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -19,6 +19,7 @@
#![feature(slice_patterns)]
#![feature(stmt_expr_attributes)]
#![feature(question_mark)]
+#![feature(try_from)]
#![deny(unsafe_code)]
#![allow(non_snake_case)]
@@ -81,7 +82,7 @@ extern crate smallvec;
#[macro_use]
extern crate style;
extern crate time;
-#[cfg(any(target_os = "macos", target_os = "linux"))]
+#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
extern crate tinyfiledialogs;
extern crate url;
#[macro_use]
@@ -105,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,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;
@@ -158,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();
@@ -179,4 +186,3 @@ pub fn init() {
pub unsafe fn script_can_initiate_scroll(_: *mut JSContext, _: Handle<*mut JSObject>) -> bool {
!opts::get().use_webrender
}
-