aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/pipeline.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/compositing/pipeline.rs')
-rw-r--r--components/compositing/pipeline.rs28
1 files changed, 15 insertions, 13 deletions
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs
index c8a054d16ef..a1dd6b3c24b 100644
--- a/components/compositing/pipeline.rs
+++ b/components/compositing/pipeline.rs
@@ -18,6 +18,7 @@ use servo_net::resource_task::ResourceTask;
use servo_net::storage_task::StorageTask;
use servo_util::time::TimeProfilerChan;
use std::rc::Rc;
+use std::sync::mpsc::{Receiver, channel};
/// A uniquely-identifiable pipeline of script task, layout task, and paint task.
pub struct Pipeline {
@@ -35,7 +36,7 @@ pub struct Pipeline {
}
/// The subset of the pipeline that is needed for layer composition.
-#[deriving(Clone)]
+#[derive(Clone)]
pub struct CompositionPipeline {
pub id: PipelineId,
pub script_chan: ScriptControlChan,
@@ -99,7 +100,7 @@ impl Pipeline {
};
let ScriptControlChan(ref chan) = spipe.script_chan;
- chan.send(ConstellationControlMsg::AttachLayout(new_layout_info));
+ chan.send(ConstellationControlMsg::AttachLayout(new_layout_info)).unwrap();
spipe.script_chan.clone()
}
};
@@ -161,41 +162,42 @@ impl Pipeline {
pub fn load(&self) {
let ScriptControlChan(ref chan) = self.script_chan;
- chan.send(ConstellationControlMsg::Load(self.id, self.load_data.clone()));
+ chan.send(ConstellationControlMsg::Load(self.id, self.load_data.clone())).unwrap();
}
pub fn grant_paint_permission(&self) {
- let _ = self.paint_chan.send_opt(PaintMsg::PaintPermissionGranted);
+ let _ = self.paint_chan.send(PaintMsg::PaintPermissionGranted);
}
pub fn revoke_paint_permission(&self) {
debug!("pipeline revoking paint channel paint permission");
- let _ = self.paint_chan.send_opt(PaintMsg::PaintPermissionRevoked);
+ let _ = self.paint_chan.send(PaintMsg::PaintPermissionRevoked);
}
pub fn exit(&self, exit_type: PipelineExitType) {
- debug!("pipeline {} exiting", self.id);
+ debug!("pipeline {:?} exiting", self.id);
// Script task handles shutting down layout, and layout handles shutting down the painter.
// For now, if the script task has failed, we give up on clean shutdown.
let ScriptControlChan(ref chan) = self.script_chan;
- if chan.send_opt(ConstellationControlMsg::ExitPipeline(self.id, exit_type)).is_ok() {
+ if chan.send(ConstellationControlMsg::ExitPipeline(self.id, exit_type)).is_ok() {
// Wait until all slave tasks have terminated and run destructors
// NOTE: We don't wait for script task as we don't always own it
- let _ = self.paint_shutdown_port.recv_opt();
- let _ = self.layout_shutdown_port.recv_opt();
+ let _ = self.paint_shutdown_port.recv();
+ let _ = self.layout_shutdown_port.recv();
}
}
pub fn force_exit(&self) {
let ScriptControlChan(ref script_channel) = self.script_chan;
- let _ = script_channel.send_opt(
+ let _ = script_channel.send(
ConstellationControlMsg::ExitPipeline(self.id,
- PipelineExitType::PipelineOnly));
- let _ = self.paint_chan.send_opt(PaintMsg::Exit(None, PipelineExitType::PipelineOnly));
+ PipelineExitType::PipelineOnly)).unwrap();
+ let _ = self.paint_chan.send(PaintMsg::Exit(None, PipelineExitType::PipelineOnly));
let LayoutControlChan(ref layout_channel) = self.layout_chan;
- let _ = layout_channel.send_opt(LayoutControlMsg::ExitNowMsg(PipelineExitType::PipelineOnly));
+ let _ = layout_channel.send(
+ LayoutControlMsg::ExitNowMsg(PipelineExitType::PipelineOnly)).unwrap();
}
pub fn to_sendable(&self) -> CompositionPipeline {