diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2018-11-07 19:48:07 +0100 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2018-11-18 19:33:19 +0100 |
commit | 9a7eeb349a8aa657e063665ac92387ab8ef3ce28 (patch) | |
tree | 63c5aa1ba7cd7fdb1bf14bcc9cbb6e6c0e24431b /components/layout_thread/lib.rs | |
parent | 76195e0779469f29a5e27cd882e2bbe8b2c9d6dd (diff) | |
download | servo-9a7eeb349a8aa657e063665ac92387ab8ef3ce28.tar.gz servo-9a7eeb349a8aa657e063665ac92387ab8ef3ce28.zip |
Update crossbeam-channel to 0.3
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r-- | components/layout_thread/lib.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 91b801464fe..772375b5994 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -6,6 +6,8 @@ //! painted. #[macro_use] +extern crate crossbeam_channel; +#[macro_use] extern crate html5ever; #[macro_use] extern crate layout; @@ -15,14 +17,13 @@ extern crate lazy_static; extern crate log; #[macro_use] extern crate profile_traits; -#[macro_use] -extern crate servo_channel; mod dom_wrapper; use app_units::Au; use crate::dom_wrapper::drop_style_and_layout_data; use crate::dom_wrapper::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNode}; +use crossbeam_channel::{unbounded, Receiver, Sender}; use embedder_traits::resources::{self, Resource}; use euclid::{Point2D, Rect, Size2D, TypedScale, TypedSize2D}; use fnv::FnvHashMap; @@ -33,6 +34,7 @@ use gfx::font_context; use gfx_traits::{node_id_from_scroll_id, Epoch}; use histogram::Histogram; use ipc_channel::ipc::{self, IpcReceiver, IpcSender}; +use ipc_channel::router::ROUTER; use layout::animation; use layout::construct::ConstructionResult; use layout::context::malloc_size_of_persistent_local_context; @@ -82,7 +84,6 @@ use script_traits::{ScrollState, UntrustedNodeAddress}; use selectors::Element; use servo_arc::Arc as ServoArc; use servo_atoms::Atom; -use servo_channel::{channel, route_ipc_receiver_to_new_servo_receiver, Receiver, Sender}; use servo_config::opts; use servo_config::prefs::PREFS; use servo_geometry::MaxRect; @@ -474,14 +475,15 @@ impl LayoutThread { debug!("Possible layout Threads: {}", layout_threads); // Create the channel on which new animations can be sent. - let (new_animations_sender, new_animations_receiver) = channel(); + let (new_animations_sender, new_animations_receiver) = unbounded(); // Proxy IPC messages from the pipeline to the layout thread. - let pipeline_receiver = route_ipc_receiver_to_new_servo_receiver(pipeline_port); + let pipeline_receiver = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(pipeline_port); // Ask the router to proxy IPC messages from the font cache thread to the layout thread. let (ipc_font_cache_sender, ipc_font_cache_receiver) = ipc::channel().unwrap(); - let font_cache_receiver = route_ipc_receiver_to_new_servo_receiver(ipc_font_cache_receiver); + let font_cache_receiver = + ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(ipc_font_cache_receiver); LayoutThread { id: id, @@ -612,9 +614,9 @@ impl LayoutThread { } let request = select! { - recv(self.pipeline_port.select(), msg) => Request::FromPipeline(msg.unwrap()), - recv(self.port.select(), msg) => Request::FromScript(msg.unwrap()), - recv(self.font_cache_receiver.select(), msg) => { msg.unwrap(); Request::FromFontCache } + recv(self.pipeline_port) -> msg => Request::FromPipeline(msg.unwrap()), + recv(self.port) -> msg => Request::FromScript(msg.unwrap()), + recv(self.font_cache_receiver) -> msg => { msg.unwrap(); Request::FromFontCache } }; match request { |