make resource_thread talk to sw-manager

This commit is contained in:
Rahul Sharma 2016-07-18 19:06:48 +05:30
parent 1e6293ea1d
commit eff3e01df0
9 changed files with 125 additions and 109 deletions

View file

@ -114,9 +114,8 @@ 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 script_traits::SWManagerSenders;
use serviceworker_manager::ServiceWorkerManager;
use std::ptr;
use util::opts;
@ -163,13 +162,13 @@ fn perform_platform_specific_initialization() {
fn perform_platform_specific_initialization() {}
#[allow(unsafe_code)]
pub fn init(from_swmanager_sender: IpcSender<SWManagerMsg>) {
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(from_swmanager_sender);
ServiceWorkerManager::spawn_manager(sw_senders);
// Create the global vtables used by the (generated) DOM
// bindings to implement JS proxies.