Remove LayoutControlChan.

This commit is contained in:
Ms2ger 2016-05-27 14:00:42 +02:00
parent e3b2d6aef0
commit ec03c367ab
8 changed files with 14 additions and 31 deletions

View file

@ -23,7 +23,7 @@ use gfx::font_cache_thread::FontCacheThread;
use gfx_traits::Epoch;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use layout_traits::{LayoutControlChan, LayoutThreadFactory};
use layout_traits::LayoutThreadFactory;
use msg::constellation_msg::WebDriverCommandMsg;
use msg::constellation_msg::{FrameId, FrameType, PipelineId};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
@ -1057,7 +1057,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
AnimationTickType::Layout => {
let msg = LayoutControlMsg::TickAnimations;
match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.layout_chan.0.send(msg),
Some(pipeline) => pipeline.layout_chan.send(msg),
None => return warn!("Pipeline {:?} got script tick after closure.", pipeline_id),
}
}
@ -1757,7 +1757,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// there's a race condition where a webfont has finished loading,
// but hasn't yet notified the document.
let msg = LayoutControlMsg::GetWebFontLoadState(state_sender.clone());
if let Err(e) = pipeline.layout_chan.0.send(msg) {
if let Err(e) = pipeline.layout_chan.send(msg) {
warn!("Get web font failed ({})", e);
}
if state_receiver.recv().unwrap_or(true) {
@ -1792,8 +1792,8 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
// epoch matches what the compositor has drawn. If they match
// (and script is idle) then this pipeline won't change again
// and can be considered stable.
let LayoutControlChan(ref layout_chan) = pipeline.layout_chan;
if let Err(e) = layout_chan.send(LayoutControlMsg::GetCurrentEpoch(epoch_sender.clone())) {
let message = LayoutControlMsg::GetCurrentEpoch(epoch_sender.clone());
if let Err(e) = pipeline.layout_chan.send(message) {
warn!("Failed to send GetCurrentEpoch ({}).", e);
}
match epoch_receiver.recv() {

View file

@ -15,7 +15,7 @@ use gfx::paint_thread::{ChromeToPaintMsg, LayoutToPaintMsg, PaintThread};
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layers::geometry::DevicePixel;
use layout_traits::{LayoutControlChan, LayoutThreadFactory};
use layout_traits::LayoutThreadFactory;
use msg::constellation_msg::{FrameId, FrameType, LoadData, PanicMsg, PipelineId};
use msg::constellation_msg::{PipelineNamespaceId, SubpageId, WindowSizeData};
use net_traits::ResourceThreads;
@ -51,7 +51,7 @@ pub struct Pipeline {
pub parent_info: Option<(PipelineId, SubpageId, FrameType)>,
pub script_chan: IpcSender<ConstellationControlMsg>,
/// A channel to layout, for performing reflows and shutdown.
pub layout_chan: LayoutControlChan,
pub layout_chan: IpcSender<LayoutControlMsg>,
/// A channel to the compositor.
pub compositor_proxy: Box<CompositorProxy + 'static + Send>,
pub chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
@ -254,7 +254,7 @@ impl Pipeline {
let pipeline = Pipeline::new(state.id,
state.parent_info,
script_chan,
LayoutControlChan(pipeline_chan),
pipeline_chan,
state.compositor_proxy,
chrome_to_paint_chan,
layout_shutdown_port,
@ -268,7 +268,7 @@ impl Pipeline {
fn new(id: PipelineId,
parent_info: Option<(PipelineId, SubpageId, FrameType)>,
script_chan: IpcSender<ConstellationControlMsg>,
layout_chan: LayoutControlChan,
layout_chan: IpcSender<LayoutControlMsg>,
compositor_proxy: Box<CompositorProxy + 'static + Send>,
chrome_to_paint_chan: Sender<ChromeToPaintMsg>,
layout_shutdown_port: IpcReceiver<()>,
@ -347,8 +347,7 @@ impl Pipeline {
if let Err(e) = self.chrome_to_paint_chan.send(ChromeToPaintMsg::Exit) {
warn!("Sending paint exit message failed ({}).", e);
}
let LayoutControlChan(ref layout_channel) = self.layout_chan;
if let Err(e) = layout_channel.send(LayoutControlMsg::ExitNow) {
if let Err(e) = self.layout_chan.send(LayoutControlMsg::ExitNow) {
warn!("Sending layout exit message failed ({}).", e);
}
}