From 61983323ae520372282f96b7e33ab7902dacc16b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 14:20:25 +0100 Subject: [PATCH 01/12] Reorder LayoutTask::exit_now for clarity. --- components/layout/layout_task.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index c86ecdedaff..5394aa178f5 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -731,8 +731,6 @@ impl LayoutTask { fn exit_now<'a>(&'a self, possibly_locked_rw_data: &mut Option>, exit_type: PipelineExitType) { - let (response_chan, response_port) = ipc::channel().unwrap(); - { let mut rw_data = self.lock_rw_data(possibly_locked_rw_data); if let Some(ref mut traversal) = (&mut *rw_data).parallel_traversal { @@ -741,6 +739,7 @@ impl LayoutTask { LayoutTask::return_rw_data(possibly_locked_rw_data, rw_data); } + let (response_chan, response_port) = ipc::channel().unwrap(); self.paint_chan.send(LayoutToPaintMsg::Exit(Some(response_chan), exit_type)).unwrap(); response_port.recv().unwrap() } From eb44bdb33ab72b0ba14593a0ddffe3774874fc12 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 15:44:31 +0100 Subject: [PATCH 02/12] Remove the unused IpcSender from ChromeToPaintMsg::Exit. --- components/compositing/pipeline.rs | 1 - components/gfx/paint_task.rs | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index ad425224d26..51b4a20ec9c 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -279,7 +279,6 @@ impl Pipeline { ConstellationControlMsg::ExitPipeline(self.id, PipelineExitType::PipelineOnly)).unwrap(); let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::Exit( - None, PipelineExitType::PipelineOnly)); let LayoutControlChan(ref layout_channel) = self.layout_chan; let _ = layout_channel.send( diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 331c25a0be2..6ba95a6aaf9 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -205,7 +205,7 @@ pub enum ChromeToPaintMsg { PaintPermissionGranted, PaintPermissionRevoked, CollectReports(ReportsChan), - Exit(Option>, PipelineExitType), + Exit(PipelineExitType), } pub struct PaintTask { @@ -382,8 +382,7 @@ impl PaintTask where C: PaintListener + Send + 'static { // FIXME(njn): should eventually measure the paint task. channel.send(Vec::new()) } - Msg::FromLayout(LayoutToPaintMsg::Exit(ref response_channel, _)) | - Msg::FromChrome(ChromeToPaintMsg::Exit(ref response_channel, _)) => { + Msg::FromLayout(LayoutToPaintMsg::Exit(ref response_channel, _)) => { // Ask the compositor to remove any layers it is holding for this paint task. // FIXME(mrobinson): This can probably move back to the constellation now. self.compositor.notify_paint_task_exiting(self.id); @@ -392,6 +391,14 @@ impl PaintTask where C: PaintListener + Send + 'static { response_channel.as_ref().map(|channel| channel.send(())); break; } + Msg::FromChrome(ChromeToPaintMsg::Exit(_)) => { + // Ask the compositor to remove any layers it is holding for this paint task. + // FIXME(mrobinson): This can probably move back to the constellation now. + self.compositor.notify_paint_task_exiting(self.id); + + debug!("PaintTask: Exiting."); + break; + } } } } From a01fd7732d3aabcfe8a38d52b82a111dadd3586a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 15:45:06 +0100 Subject: [PATCH 03/12] Remove the unused Option around the IpcSender from LayoutToPaintMsg::Exit. --- components/gfx/paint_task.rs | 4 ++-- components/layout/layout_task.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 6ba95a6aaf9..4b64bde4dd9 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -197,7 +197,7 @@ pub enum Msg { pub enum LayoutToPaintMsg { PaintInit(Epoch, PaintLayer), CanvasLayer(LayerId, IpcSender), - Exit(Option>, PipelineExitType), + Exit(IpcSender<()>, PipelineExitType), } pub enum ChromeToPaintMsg { @@ -388,7 +388,7 @@ impl PaintTask where C: PaintListener + Send + 'static { self.compositor.notify_paint_task_exiting(self.id); debug!("PaintTask: Exiting."); - response_channel.as_ref().map(|channel| channel.send(())); + let _ = response_channel.send(()); break; } Msg::FromChrome(ChromeToPaintMsg::Exit(_)) => { diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 5394aa178f5..97ffc67f8d2 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -740,7 +740,7 @@ impl LayoutTask { } let (response_chan, response_port) = ipc::channel().unwrap(); - self.paint_chan.send(LayoutToPaintMsg::Exit(Some(response_chan), exit_type)).unwrap(); + self.paint_chan.send(LayoutToPaintMsg::Exit(response_chan, exit_type)).unwrap(); response_port.recv().unwrap() } From 995d022bb9e3b381f36f37995f16562dd6c5ddf0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 15:46:44 +0100 Subject: [PATCH 04/12] Remove the unused PipelineExitType from LayoutToPaintMsg::Exit. --- components/gfx/paint_task.rs | 4 ++-- components/layout/layout_task.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index 4b64bde4dd9..f88d0099559 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -197,7 +197,7 @@ pub enum Msg { pub enum LayoutToPaintMsg { PaintInit(Epoch, PaintLayer), CanvasLayer(LayerId, IpcSender), - Exit(IpcSender<()>, PipelineExitType), + Exit(IpcSender<()>), } pub enum ChromeToPaintMsg { @@ -382,7 +382,7 @@ impl PaintTask where C: PaintListener + Send + 'static { // FIXME(njn): should eventually measure the paint task. channel.send(Vec::new()) } - Msg::FromLayout(LayoutToPaintMsg::Exit(ref response_channel, _)) => { + Msg::FromLayout(LayoutToPaintMsg::Exit(ref response_channel)) => { // Ask the compositor to remove any layers it is holding for this paint task. // FIXME(mrobinson): This can probably move back to the constellation now. self.compositor.notify_paint_task_exiting(self.id); diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 97ffc67f8d2..8000c431734 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -730,7 +730,7 @@ impl LayoutTask { /// crash. fn exit_now<'a>(&'a self, possibly_locked_rw_data: &mut Option>, - exit_type: PipelineExitType) { + _: PipelineExitType) { { let mut rw_data = self.lock_rw_data(possibly_locked_rw_data); if let Some(ref mut traversal) = (&mut *rw_data).parallel_traversal { @@ -740,7 +740,7 @@ impl LayoutTask { } let (response_chan, response_port) = ipc::channel().unwrap(); - self.paint_chan.send(LayoutToPaintMsg::Exit(response_chan, exit_type)).unwrap(); + self.paint_chan.send(LayoutToPaintMsg::Exit(response_chan)).unwrap(); response_port.recv().unwrap() } From 5cd250602ffa43d87c8131456be089e749887a3a Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:09:39 +0100 Subject: [PATCH 05/12] Remove the unused PipelineExitType argument to LayoutTask::exit_now. --- components/layout/layout_task.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 8000c431734..1a5fea87482 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; @@ -631,9 +631,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 } } @@ -711,9 +711,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(_) => { @@ -729,8 +729,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>, - _: PipelineExitType) { + possibly_locked_rw_data: &mut Option>) { { let mut rw_data = self.lock_rw_data(possibly_locked_rw_data); if let Some(ref mut traversal) = (&mut *rw_data).parallel_traversal { From ad33d920e702b4fb0752d83e10b9a6073d2cb66b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:11:52 +0100 Subject: [PATCH 06/12] Remove the unused PipelineExitType field from layout_interface::Msg::ExitNow. --- components/layout/layout_task.rs | 8 ++++---- components/script/layout_interface.rs | 4 ++-- components/script/script_task.rs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 1a5fea87482..8b3a1555af5 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -492,8 +492,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) } } @@ -631,7 +631,7 @@ impl LayoutTask { self.prepare_to_exit(response_chan, possibly_locked_rw_data); return false }, - Msg::ExitNow(_) => { + Msg::ExitNow => { debug!("layout: ExitNow received"); self.exit_now(possibly_locked_rw_data); return false @@ -711,7 +711,7 @@ impl LayoutTask { self.handle_reap_layout_data(dead_layout_data) } } - Msg::ExitNow(_) => { + Msg::ExitNow => { debug!("layout task is exiting..."); self.exit_now(possibly_locked_rw_data); break diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs index afc7adedbd3..7a735d22737 100644 --- a/components/script/layout_interface.rs +++ b/components/script/layout_interface.rs @@ -14,7 +14,7 @@ use ipc_channel::ipc::{IpcReceiver, IpcSender}; use libc::uintptr_t; use msg::compositor_msg::Epoch; use msg::compositor_msg::LayerId; -use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId}; +use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use msg::constellation_msg::{WindowSizeData}; use net_traits::PendingAsyncLoad; use net_traits::image_cache_task::ImageCacheTask; @@ -78,7 +78,7 @@ pub enum Msg { /// Requests that the layout task immediately shut down. There must be no more nodes left after /// this, or layout will crash. - ExitNow(PipelineExitType), + ExitNow, /// Get the last epoch counter for this layout task. GetCurrentEpoch(IpcSender), diff --git a/components/script/script_task.rs b/components/script/script_task.rs index ac67e4a5996..508e5c476b9 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -1455,7 +1455,7 @@ impl ScriptTask { if chan.send(layout_interface::Msg::PrepareToExit(response_chan)).is_ok() { debug!("shutting down layout for page {:?}", id); response_port.recv().unwrap(); - chan.send(layout_interface::Msg::ExitNow(exit_type)).ok(); + chan.send(layout_interface::Msg::ExitNow).ok(); } let has_pending_loads = self.incomplete_loads.borrow().len() > 0; @@ -1970,7 +1970,7 @@ impl Drop for ScriptTask { } /// Shuts down layout for the given page tree. -fn shut_down_layout(page_tree: &Rc, exit_type: PipelineExitType) { +fn shut_down_layout(page_tree: &Rc, _: PipelineExitType) { let mut channels = vec!(); for page in page_tree.iter() { @@ -1995,7 +1995,7 @@ fn shut_down_layout(page_tree: &Rc, exit_type: PipelineExitType) { // Destroy the layout task. If there were node leaks, layout will now crash safely. for chan in channels { - chan.send(layout_interface::Msg::ExitNow(exit_type)).ok(); + chan.send(layout_interface::Msg::ExitNow).ok(); } } From ef20972023aef0a57e7128db8817415dea4819d9 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:20:59 +0100 Subject: [PATCH 07/12] Remove the unused PipelineExitType arguments from ScriptTask::handle_exit_pipeline_msg and shut_down_layout. --- components/script/script_task.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 508e5c476b9..3949f7f2b8a 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -64,7 +64,7 @@ use mem::heap_size_of_self_and_children; use msg::compositor_msg::{EventResult, LayerId, ScriptToCompositorMsg}; use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::{ConstellationChan, FocusType, LoadData}; -use msg::constellation_msg::{MozBrowserEvent, PipelineExitType, PipelineId}; +use msg::constellation_msg::{MozBrowserEvent, PipelineId}; use msg::constellation_msg::{PipelineNamespace}; use msg::constellation_msg::{SubpageId, WindowSizeData, WorkerId}; use msg::webdriver_msg::WebDriverScriptCommand; @@ -839,8 +839,8 @@ impl ScriptTask { let result = self.profile_event(category, move || { match msg { - MixedMessage::FromConstellation(ConstellationControlMsg::ExitPipeline(id, exit_type)) => { - if self.handle_exit_pipeline_msg(id, exit_type) { + MixedMessage::FromConstellation(ConstellationControlMsg::ExitPipeline(id, _)) => { + if self.handle_exit_pipeline_msg(id) { return Some(false) } }, @@ -1437,7 +1437,7 @@ impl ScriptTask { /// Handles a request to exit the script task and shut down layout. /// Returns true if the script task should shut down and false otherwise. - fn handle_exit_pipeline_msg(&self, id: PipelineId, exit_type: PipelineExitType) -> bool { + fn handle_exit_pipeline_msg(&self, id: PipelineId) -> bool { self.closed_pipelines.borrow_mut().insert(id); // Check if the exit message is for an in progress load. @@ -1470,13 +1470,13 @@ impl ScriptTask { let window = page.window(); if window.pipeline() == id { debug!("shutting down layout for root page {:?}", id); - shut_down_layout(&page, exit_type); + shut_down_layout(&page); return true } // otherwise find just the matching page and exit all sub-pages if let Some(ref mut child_page) = page.remove(id) { - shut_down_layout(&*child_page, exit_type); + shut_down_layout(&*child_page); } false } @@ -1970,7 +1970,7 @@ impl Drop for ScriptTask { } /// Shuts down layout for the given page tree. -fn shut_down_layout(page_tree: &Rc, _: PipelineExitType) { +fn shut_down_layout(page_tree: &Rc) { let mut channels = vec!(); for page in page_tree.iter() { From 85a762a31ad4a8f4c108ba1969f5b16b84a24b15 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:29:07 +0100 Subject: [PATCH 08/12] Remove the unused PipelineExitType field from ConstellationControlMsg::ExitPipeline. --- components/compositing/pipeline.rs | 8 +++----- components/script/script_task.rs | 2 +- components/script_traits/lib.rs | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 51b4a20ec9c..0215ac4cade 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -248,13 +248,13 @@ impl Pipeline { let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::PaintPermissionRevoked); } - pub fn exit(&self, exit_type: PipelineExitType) { + pub fn exit(&self, _: PipelineExitType) { 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. if self.script_chan - .send(ConstellationControlMsg::ExitPipeline(self.id, exit_type)) + .send(ConstellationControlMsg::ExitPipeline(self.id)) .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 @@ -275,9 +275,7 @@ impl Pipeline { } pub fn force_exit(&self) { - let _ = self.script_chan.send( - ConstellationControlMsg::ExitPipeline(self.id, - PipelineExitType::PipelineOnly)).unwrap(); + let _ = self.script_chan.send(ConstellationControlMsg::ExitPipeline(self.id)).unwrap(); let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::Exit( PipelineExitType::PipelineOnly)); let LayoutControlChan(ref layout_channel) = self.layout_chan; diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 3949f7f2b8a..d463d1d8107 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -839,7 +839,7 @@ impl ScriptTask { let result = self.profile_event(category, move || { match msg { - MixedMessage::FromConstellation(ConstellationControlMsg::ExitPipeline(id, _)) => { + MixedMessage::FromConstellation(ConstellationControlMsg::ExitPipeline(id)) => { if self.handle_exit_pipeline_msg(id) { return Some(false) } diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 2db79ff93d3..1adf0c6602d 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -115,7 +115,7 @@ pub enum ConstellationControlMsg { /// Notifies script that window has been resized but to not take immediate action. ResizeInactive(PipelineId, WindowSizeData), /// Notifies the script that a pipeline should be closed. - ExitPipeline(PipelineId, PipelineExitType), + ExitPipeline(PipelineId), /// Sends a DOM event. SendEvent(PipelineId, CompositorEvent), /// Notifies script of the viewport. From ffffc5f06551f791be7457c6fc0d0fa20e1e782e Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:30:22 +0100 Subject: [PATCH 09/12] Remove the unused PipelineExitType argument from Pipeline::exit. --- components/compositing/constellation.rs | 6 +++--- components/compositing/pipeline.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index adfb9fb5b21..c4b1c9bd5d4 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -25,7 +25,7 @@ use msg::compositor_msg::Epoch; use msg::constellation_msg::AnimationState; use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::WebDriverCommandMsg; -use msg::constellation_msg::{FrameId, PipelineExitType, PipelineId}; +use msg::constellation_msg::{FrameId, PipelineId}; use msg::constellation_msg::{IframeLoadInfo, IFrameSandboxState, MozBrowserEvent, NavigationDirection}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId}; @@ -565,7 +565,7 @@ impl Constellation { fn handle_exit(&mut self) { for (_id, ref pipeline) in &self.pipelines { - pipeline.exit(PipelineExitType::Complete); + pipeline.exit(); } self.image_cache_task.exit(); self.resource_task.send(net_traits::ControlMsg::Exit).unwrap(); @@ -1356,7 +1356,7 @@ impl Constellation { // Inform script, compositor that this pipeline has exited. match exit_mode { - ExitPipelineMode::Normal => pipeline.exit(PipelineExitType::PipelineOnly), + ExitPipelineMode::Normal => pipeline.exit(), ExitPipelineMode::Force => pipeline.force_exit(), } } diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 0215ac4cade..75d166f5f76 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -248,7 +248,7 @@ impl Pipeline { let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::PaintPermissionRevoked); } - pub fn exit(&self, _: PipelineExitType) { + pub fn exit(&self) { debug!("pipeline {:?} exiting", self.id); // Script task handles shutting down layout, and layout handles shutting down the painter. From f37b8e9f4da46d7ce93e9adb62ce5d3d5fc6cdd0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:31:37 +0100 Subject: [PATCH 10/12] Remove the unused PipelineExitType field from ChromeToPaintMsg::Exit. --- components/compositing/pipeline.rs | 3 +-- components/gfx/paint_task.rs | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 75d166f5f76..2bc78c22ed2 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -276,8 +276,7 @@ impl Pipeline { pub fn force_exit(&self) { let _ = self.script_chan.send(ConstellationControlMsg::ExitPipeline(self.id)).unwrap(); - let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::Exit( - PipelineExitType::PipelineOnly)); + let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::Exit); let LayoutControlChan(ref layout_channel) = self.layout_chan; let _ = layout_channel.send( LayoutControlMsg::ExitNow(PipelineExitType::PipelineOnly)).unwrap(); diff --git a/components/gfx/paint_task.rs b/components/gfx/paint_task.rs index f88d0099559..23da15a3ee1 100644 --- a/components/gfx/paint_task.rs +++ b/components/gfx/paint_task.rs @@ -22,7 +22,7 @@ use layers::platform::surface::{NativeDisplay, NativeSurface}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind, LayerProperties}; use msg::compositor_msg::{PaintListener, ScrollPolicy}; use msg::constellation_msg::Msg as ConstellationMsg; -use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, PipelineId}; +use msg::constellation_msg::{ConstellationChan, Failure, PipelineId}; use paint_context::PaintContext; use profile_traits::mem::{self, ReportsChan}; use profile_traits::time::{self, profile}; @@ -205,7 +205,7 @@ pub enum ChromeToPaintMsg { PaintPermissionGranted, PaintPermissionRevoked, CollectReports(ReportsChan), - Exit(PipelineExitType), + Exit, } pub struct PaintTask { @@ -391,7 +391,7 @@ impl PaintTask where C: PaintListener + Send + 'static { let _ = response_channel.send(()); break; } - Msg::FromChrome(ChromeToPaintMsg::Exit(_)) => { + Msg::FromChrome(ChromeToPaintMsg::Exit) => { // Ask the compositor to remove any layers it is holding for this paint task. // FIXME(mrobinson): This can probably move back to the constellation now. self.compositor.notify_paint_task_exiting(self.id); From 7d3f7220f7b436301329a05f3a3c01cc5775bdf0 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:32:08 +0100 Subject: [PATCH 11/12] Remove the unused PipelineExitType field from LayoutControlMsg::ExitNow. --- components/compositing/pipeline.rs | 5 ++--- components/layout/layout_task.rs | 2 +- components/script_traits/lib.rs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index 2bc78c22ed2..4cc8b87f14a 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -15,7 +15,7 @@ use ipc_channel::router::ROUTER; use layers::geometry::DevicePixel; use layout_traits::{LayoutControlChan, LayoutTaskFactory}; use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId}; -use msg::constellation_msg::{LoadData, MozBrowserEvent, PipelineExitType, WindowSizeData}; +use msg::constellation_msg::{LoadData, MozBrowserEvent, WindowSizeData}; use msg::constellation_msg::{PipelineNamespaceId}; use net_traits::ResourceTask; use net_traits::image_cache_task::ImageCacheTask; @@ -278,8 +278,7 @@ impl Pipeline { let _ = self.script_chan.send(ConstellationControlMsg::ExitPipeline(self.id)).unwrap(); let _ = self.chrome_to_paint_chan.send(ChromeToPaintMsg::Exit); let LayoutControlChan(ref layout_channel) = self.layout_chan; - let _ = layout_channel.send( - LayoutControlMsg::ExitNow(PipelineExitType::PipelineOnly)).unwrap(); + let _ = layout_channel.send(LayoutControlMsg::ExitNow).unwrap(); } pub fn to_sendable(&self) -> CompositionPipeline { diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 8b3a1555af5..15942e96958 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -492,7 +492,7 @@ impl LayoutTask { self.handle_request_helper(Msg::GetWebFontLoadState(sender), possibly_locked_rw_data) } - LayoutControlMsg::ExitNow(_) => { + LayoutControlMsg::ExitNow => { self.handle_request_helper(Msg::ExitNow, possibly_locked_rw_data) } diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 1adf0c6602d..0978e1700ec 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -33,7 +33,7 @@ use libc::c_void; use msg::compositor_msg::{Epoch, LayerId, ScriptToCompositorMsg}; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId}; -use msg::constellation_msg::{MozBrowserEvent, PipelineExitType, PipelineNamespaceId}; +use msg::constellation_msg::{MozBrowserEvent, PipelineNamespaceId}; use msg::webdriver_msg::WebDriverScriptCommand; use net_traits::ResourceTask; use net_traits::image_cache_task::ImageCacheTask; @@ -55,7 +55,7 @@ unsafe impl Send for UntrustedNodeAddress {} #[derive(Deserialize, Serialize)] pub enum LayoutControlMsg { /// Requests that this layout task exit. - ExitNow(PipelineExitType), + ExitNow, /// Requests the current epoch (layout counter) from this layout. GetCurrentEpoch(IpcSender), /// Asks layout to run another step in its animation. From 28f5d54334b17064b0eaf02614b8256f27f4bfb2 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 5 Nov 2015 16:32:23 +0100 Subject: [PATCH 12/12] Remove the unused PipelineExitType enum. --- components/msg/constellation_msg.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/components/msg/constellation_msg.rs b/components/msg/constellation_msg.rs index 98fdcc052fb..26fcb842d0e 100644 --- a/components/msg/constellation_msg.rs +++ b/components/msg/constellation_msg.rs @@ -517,11 +517,3 @@ impl fmt::Display for PipelineId { #[derive(Clone, PartialEq, Eq, Copy, Hash, Debug, Deserialize, Serialize, HeapSizeOf)] pub struct SubpageId(pub u32); - -// The type of pipeline exit. During complete shutdowns, pipelines do not have to -// release resources automatically released on process termination. -#[derive(Copy, Clone, Debug, Deserialize, Serialize)] -pub enum PipelineExitType { - PipelineOnly, - Complete, -}