mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
This commit is contained in:
parent
ff8cbff810
commit
95fc29fa0d
255 changed files with 3550 additions and 3362 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue