diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-07 22:34:45 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-11-07 22:34:45 +0530 |
commit | 9a465c58429547b59b8a6e1258eaaea46bf7e5a2 (patch) | |
tree | 698f938b9cbbc80be946853d4704357c84e8192a /components/layout/layout_task.rs | |
parent | 7c4fd5e77078b523ae368f42c7d43c9d76acaf50 (diff) | |
parent | 28f5d54334b17064b0eaf02614b8256f27f4bfb2 (diff) | |
download | servo-9a465c58429547b59b8a6e1258eaaea46bf7e5a2.tar.gz servo-9a465c58429547b59b8a6e1258eaaea46bf7e5a2.zip |
Auto merge of #8355 - Ms2ger:Exit, r=nox
Cleanup exit messages and related code.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8355)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r-- | components/layout/layout_task.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 8881a174dec..c001fc31ee9 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -40,7 +40,7 @@ use layout_traits::LayoutTaskFactory; use log; use msg::compositor_msg::{Epoch, LayerId, ScrollPolicy}; use msg::constellation_msg::Msg as ConstellationMsg; -use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId}; +use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheResult, ImageCacheTask}; use net_traits::{PendingAsyncLoad, load_bytes_iter}; use opaque_node::OpaqueNodeMethods; @@ -493,8 +493,8 @@ impl LayoutTask { self.handle_request_helper(Msg::GetWebFontLoadState(sender), possibly_locked_rw_data) } - LayoutControlMsg::ExitNow(exit_type) => { - self.handle_request_helper(Msg::ExitNow(exit_type), + LayoutControlMsg::ExitNow => { + self.handle_request_helper(Msg::ExitNow, possibly_locked_rw_data) } } @@ -632,9 +632,9 @@ impl LayoutTask { self.prepare_to_exit(response_chan, possibly_locked_rw_data); return false }, - Msg::ExitNow(exit_type) => { + Msg::ExitNow => { debug!("layout: ExitNow received"); - self.exit_now(possibly_locked_rw_data, exit_type); + self.exit_now(possibly_locked_rw_data); return false } } @@ -712,9 +712,9 @@ impl LayoutTask { self.handle_reap_layout_data(dead_layout_data) } } - Msg::ExitNow(exit_type) => { + Msg::ExitNow => { debug!("layout task is exiting..."); - self.exit_now(possibly_locked_rw_data, exit_type); + self.exit_now(possibly_locked_rw_data); break } Msg::CollectReports(_) => { @@ -730,10 +730,7 @@ impl LayoutTask { /// Shuts down the layout task now. If there are any DOM nodes left, layout will now (safely) /// crash. fn exit_now<'a>(&'a self, - possibly_locked_rw_data: &mut Option<MutexGuard<'a, LayoutTaskData>>, - exit_type: PipelineExitType) { - let (response_chan, response_port) = ipc::channel().unwrap(); - + possibly_locked_rw_data: &mut Option<MutexGuard<'a, LayoutTaskData>>) { { let mut rw_data = self.lock_rw_data(possibly_locked_rw_data); if let Some(ref mut traversal) = (&mut *rw_data).parallel_traversal { @@ -742,7 +739,8 @@ impl LayoutTask { LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data); } - self.paint_chan.send(LayoutToPaintMsg::Exit(Some(response_chan), exit_type)).unwrap(); + let (response_chan, response_port) = ipc::channel().unwrap(); + self.paint_chan.send(LayoutToPaintMsg::Exit(response_chan)).unwrap(); response_port.recv().unwrap() } |