refactor(bluetooth): uses embedderproxy directly

This commit is contained in:
OJ Kwon 2018-04-17 19:46:02 -07:00
parent 5574b42126
commit 61b4a891bb
No known key found for this signature in database
GPG key ID: FFCFEF3460FD1901
7 changed files with 46 additions and 67 deletions

View file

@ -67,7 +67,8 @@ fn webdriver(port: u16, constellation: Sender<ConstellationMsg>) {
#[cfg(not(feature = "webdriver"))]
fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { }
use bluetooth::new_bluetooth_thread;
use bluetooth::BluetoothThreadFactory;
use bluetooth_traits::BluetoothRequest;
use canvas::gl_context::GLContextFactory;
use canvas::webgl_thread::WebGLThreads;
use compositing::{IOCompositor, ShutdownState, RenderNotifier};
@ -457,7 +458,7 @@ fn create_constellation(user_agent: Cow<'static, str>,
webrender_api_sender: webrender_api::RenderApiSender,
window_gl: Rc<gl::Gl>)
-> (Sender<ConstellationMsg>, SWManagerSenders) {
let (bluetooth_thread, bluetooth_constellation_sender) = new_bluetooth_thread();
let bluetooth_thread: IpcSender<BluetoothRequest> = BluetoothThreadFactory::new(embedder_proxy.clone());
let (public_resource_threads, private_resource_threads) =
new_resource_threads(user_agent,
@ -525,9 +526,7 @@ fn create_constellation(user_agent: Cow<'static, str>,
webgl_threads,
webvr_chan,
};
let (constellation_chan,
from_swmanager_sender,
from_bluetoothmanager_sender) =
let (constellation_chan, from_swmanager_sender) =
Constellation::<script_layout_interface::message::Msg,
layout_thread::LayoutThread,
script::script_thread::ScriptThread>::start(initial_state);
@ -537,8 +536,6 @@ fn create_constellation(user_agent: Cow<'static, str>,
webvr_constellation_sender.send(constellation_chan.clone()).unwrap();
}
bluetooth_constellation_sender.send(from_bluetoothmanager_sender.clone()).unwrap();
// channels to communicate with Service Worker Manager
let sw_senders = SWManagerSenders {
swmanager_sender: from_swmanager_sender,