diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 864c8e33cd3..4b3f4dbf94e 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -27,7 +27,7 @@ use layers::platform::surface::NativeDisplay; use layers::rendergl; use layers::rendergl::RenderContext; use layers::scene::Scene; -use layout_traits::{ConvertPipelineIdToWebRender, LayoutControlChan}; +use layout_traits::ConvertPipelineIdToWebRender; use msg::constellation_msg::{Image, PixelFormat}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{NavigationDirection, PipelineId, PipelineIndex, PipelineNamespaceId}; @@ -1668,9 +1668,8 @@ impl IOCompositor { for (pipeline_id, new_visible_rects) in &new_visible_rects { if let Some(pipeline_details) = self.pipeline_details.get(&pipeline_id) { if let Some(ref pipeline) = pipeline_details.pipeline { - let LayoutControlChan(ref sender) = pipeline.layout_chan; let msg = LayoutControlMsg::SetVisibleRects((*new_visible_rects).clone()); - if let Err(e) = sender.send(msg) { + if let Err(e) = pipeline.layout_chan.send(msg) { warn!("Sending layout control message failed ({}).", e); } } diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index 9ff82438d66..6563737573a 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -41,9 +41,8 @@ pub use compositor_thread::{CompositorEventListener, CompositorProxy, Compositor use euclid::size::TypedSize2D; use gfx::paint_thread::ChromeToPaintMsg; use ipc_channel::ipc::IpcSender; -use layout_traits::LayoutControlChan; use msg::constellation_msg::PipelineId; -use script_traits::ConstellationControlMsg; +use script_traits::{ConstellationControlMsg, LayoutControlMsg}; use std::sync::mpsc::Sender; use util::geometry::PagePx; @@ -66,6 +65,6 @@ pub struct SendableFrameTree { pub struct CompositionPipeline { pub id: PipelineId, pub script_chan: IpcSender, - pub layout_chan: LayoutControlChan, + pub layout_chan: IpcSender, pub chrome_to_paint_chan: Sender, } diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 08befa34e96..5ac8eea10f2 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -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 Constellation 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 Constellation // 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 Constellation // 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() { diff --git a/components/constellation/pipeline.rs b/components/constellation/pipeline.rs index 330eb345998..3f4abbbbc3e 100644 --- a/components/constellation/pipeline.rs +++ b/components/constellation/pipeline.rs @@ -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, /// A channel to layout, for performing reflows and shutdown. - pub layout_chan: LayoutControlChan, + pub layout_chan: IpcSender, /// A channel to the compositor. pub compositor_proxy: Box, pub chrome_to_paint_chan: Sender, @@ -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, - layout_chan: LayoutControlChan, + layout_chan: IpcSender, compositor_proxy: Box, chrome_to_paint_chan: Sender, 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); } } diff --git a/components/layout_traits/Cargo.toml b/components/layout_traits/Cargo.toml index 299a236e3d2..6b1b0170780 100644 --- a/components/layout_traits/Cargo.toml +++ b/components/layout_traits/Cargo.toml @@ -17,6 +17,4 @@ profile_traits = {path = "../profile_traits"} util = {path = "../util"} ipc-channel = {git = "https://github.com/servo/ipc-channel"} webrender_traits = {git = "https://github.com/servo/webrender_traits"} -serde = "0.7" -serde_macros = "0.7" url = {version = "1.0.0", features = ["heap_size"]} diff --git a/components/layout_traits/lib.rs b/components/layout_traits/lib.rs index b6a93e98a25..5d1261be127 100644 --- a/components/layout_traits/lib.rs +++ b/components/layout_traits/lib.rs @@ -2,9 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#![feature(custom_derive, plugin)] -#![plugin(serde_macros)] - #![deny(unsafe_code)] extern crate gfx; @@ -13,7 +10,6 @@ extern crate msg; extern crate net_traits; extern crate profile_traits; extern crate script_traits; -extern crate serde; extern crate url; extern crate util; extern crate webrender_traits; @@ -35,10 +31,6 @@ use std::sync::mpsc::{Sender, Receiver}; use url::Url; use util::ipc::OptionalIpcSender; -/// A channel wrapper for constellation messages -#[derive(Clone, Deserialize, Serialize)] -pub struct LayoutControlChan(pub IpcSender); - // A static method creating a layout thread // Here to remove the compositor -> layout dependency pub trait LayoutThreadFactory { diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index c27228c2cc2..dda55cb1be3 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -1180,8 +1180,6 @@ dependencies = [ "net_traits 0.0.1", "profile_traits 0.0.1", "script_traits 0.0.1", - "serde 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index 5c20ab160e1..ab851878230 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -1085,8 +1085,6 @@ dependencies = [ "net_traits 0.0.1", "profile_traits 0.0.1", "script_traits 0.0.1", - "serde 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_macros 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",