diff options
author | Michael Howell <michael@notriddle.com> | 2016-01-01 17:11:10 -0700 |
---|---|---|
committer | Michael Howell <michael@notriddle.com> | 2016-03-24 11:18:54 -0700 |
commit | c9cb4839e42a63120f4fc165b8e569f62fb4be44 (patch) | |
tree | b0fbb76e5e546acb736a7c8df33f7361c5919299 /components/compositing/pipeline.rs | |
parent | f2f05869d6ccd445df9b73e2e8d038c6cfa9e687 (diff) | |
download | servo-c9cb4839e42a63120f4fc165b8e569f62fb4be44.tar.gz servo-c9cb4839e42a63120f4fc165b8e569f62fb4be44.zip |
No more headless compositor. Just the normal one.
This changes headless operation to strictly be a runtime option, rather
than a compile-time one. Note that the old headless version still relied
on a display server to support WebGL, while it now requires one all the
time.
Fixes #8573
Diffstat (limited to 'components/compositing/pipeline.rs')
-rw-r--r-- | components/compositing/pipeline.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index bbf892048c8..40b1a2baa6a 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -28,13 +28,13 @@ use script_traits::{LayoutControlMsg, LayoutMsg, NewLayoutInfo, ScriptMsg}; use script_traits::{ScriptToCompositorMsg, ScriptThreadFactory, TimerEventRequest}; use std::mem; use std::sync::mpsc::{Receiver, Sender, channel}; -use std::thread; use url::Url; use util; use util::geometry::{PagePx, ViewportPx}; use util::ipc::OptionalIpcSender; use util::opts::{self, Opts}; use util::prefs; +use util::thread; use webrender_traits; /// A uniquely-identifiable pipeline of script thread, layout thread, and paint thread. @@ -290,6 +290,13 @@ impl Pipeline { pub fn exit(&self) { debug!("pipeline {:?} exiting", self.id); + // The compositor wants to know when pipelines shut down too. + // It may still have messages to process from these other threads + // before they can be safely shut down. + let (sender, receiver) = ipc::channel().unwrap(); + self.compositor_proxy.send(CompositorMsg::PipelineExited(self.id, sender)); + receiver.recv().unwrap(); + // Script thread handles shutting down layout, and layout handles shutting down the painter. // For now, if the script thread has failed, we give up on clean shutdown. if self.script_chan @@ -300,9 +307,6 @@ impl Pipeline { let _ = self.paint_shutdown_port.recv(); let _ = self.layout_shutdown_port.recv(); } - - // The compositor wants to know when pipelines shut down too. - self.compositor_proxy.send(CompositorMsg::PipelineExited(self.id)) } pub fn freeze(&self) { @@ -472,7 +476,7 @@ impl PrivilegedPipelineContent { let compositor_proxy_for_script_listener_thread = self.compositor_proxy.clone_compositor_proxy(); let script_to_compositor_port = self.script_to_compositor_port; - thread::spawn(move || { + thread::spawn_named("CompositorScriptListener".to_owned(), move || { compositor_thread::run_script_listener_thread( compositor_proxy_for_script_listener_thread, script_to_compositor_port) |