Integrate service worker manager thread

This commit is contained in:
Rahul Sharma 2016-06-09 18:52:52 +05:30
parent e8fa02a07f
commit 1e6293ea1d
39 changed files with 764 additions and 582 deletions

View file

@ -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();