aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo
diff options
context:
space:
mode:
Diffstat (limited to 'components/servo')
-rw-r--r--components/servo/lib.rs22
1 files changed, 17 insertions, 5 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 77c5b8e8fe0..22279a4189b 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -68,8 +68,8 @@ fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { }
use bluetooth::BluetoothThreadFactory;
use bluetooth_traits::BluetoothRequest;
-use compositing::{CompositorProxy, IOCompositor};
-use compositing::compositor_thread::InitialCompositorState;
+use compositing::IOCompositor;
+use compositing::compositor_thread::{self, CompositorProxy, CompositorReceiver, InitialCompositorState};
use compositing::windowing::WindowEvent;
use compositing::windowing::WindowMethods;
use constellation::{Constellation, InitialConstellationState, UnprivilegedPipelineContent};
@@ -97,7 +97,7 @@ use std::borrow::Cow;
use std::cmp::max;
use std::path::PathBuf;
use std::rc::Rc;
-use std::sync::mpsc::Sender;
+use std::sync::mpsc::{Sender, channel};
use webrender::renderer::RendererKind;
use webvr::{WebVRThread, WebVRCompositorHandler};
@@ -134,7 +134,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
// messages to client may need to pump a platform-specific event loop
// to deliver the message.
let (compositor_proxy, compositor_receiver) =
- window.create_compositor_channel();
+ create_compositor_channel(window.create_event_loop_waker());
let supports_clipboard = window.supports_clipboard();
let time_profiler_chan = profile_time::Profiler::create(&opts.time_profiling,
opts.time_profiler_trace_path.clone());
@@ -273,10 +273,22 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
}
}
+fn create_compositor_channel(event_loop_waker: Box<compositor_thread::EventLoopWaker>)
+ -> (CompositorProxy, CompositorReceiver) {
+ let (sender, receiver) = channel();
+ (CompositorProxy {
+ sender: sender,
+ event_loop_waker: event_loop_waker,
+ },
+ CompositorReceiver {
+ receiver: receiver
+ })
+}
+
fn create_constellation(user_agent: Cow<'static, str>,
config_dir: Option<PathBuf>,
url: Option<ServoUrl>,
- compositor_proxy: Box<CompositorProxy + Send>,
+ compositor_proxy: CompositorProxy,
time_profiler_chan: time::ProfilerChan,
mem_profiler_chan: mem::ProfilerChan,
debugger_chan: Option<debugger::Sender>,