diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 36688456333..4c3a3505b62 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -504,8 +504,10 @@ impl IOCompositor { fn handle_browser_message(&mut self, msg: Msg) -> bool { match (msg, self.shutdown_state) { - (_, ShutdownState::FinishedShuttingDown) => - panic!("compositor shouldn't be handling messages after shutting down"), + (_, ShutdownState::FinishedShuttingDown) => { + error!("compositor shouldn't be handling messages after shutting down"); + return false + } (Msg::Exit(channel), _) => { self.start_shutting_down(); @@ -780,7 +782,10 @@ impl IOCompositor { pub fn pipeline(&self, pipeline_id: PipelineId) -> Option<&CompositionPipeline> { match self.pipeline_details.get(&pipeline_id) { Some(ref details) => details.pipeline.as_ref(), - None => panic!("Compositor layer has an unknown pipeline ({:?}).", pipeline_id), + None => { + warn!("Compositor layer has an unknown pipeline ({:?}).", pipeline_id); + None + } } } @@ -881,7 +886,8 @@ impl IOCompositor { fn find_pipeline_root_layer(&self, pipeline_id: PipelineId) -> Option>> { if !self.pipeline_details.contains_key(&pipeline_id) { - panic!("Tried to create or update layer for unknown pipeline") + warn!("Tried to create or update layer for unknown pipeline"); + return None; } self.find_layer_with_pipeline_and_layer_id(pipeline_id, LayerId::null()) } @@ -1119,7 +1125,7 @@ impl IOCompositor { layer_id: LayerId) { if let Some(point) = self.fragment_point.take() { if !self.move_layer(pipeline_id, layer_id, Point2D::from_untyped(&point)) { - panic!("Compositor: Tried to scroll to fragment with unknown layer."); + return warn!("Compositor: Tried to scroll to fragment with unknown layer."); } self.perform_updates_after_scroll(); diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 531a589c6aa..0606aa14ffd 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -505,7 +505,8 @@ impl Constellation #[cfg(target_os = "windows")] fn spawn_multiprocess(&mut self, _: PipelineId, _: UnprivilegedPipelineContent) { - panic!("Multiprocess is not supported on Windows."); + error!("Multiprocess is not supported on Windows."); + process::exit(1); } // Push a new (loading) pipeline to the list of pending frame changes diff --git a/etc/ci/check_no_unwrap.sh b/etc/ci/check_no_unwrap.sh index bbf5eabce88..c2a35d06674 100755 --- a/etc/ci/check_no_unwrap.sh +++ b/etc/ci/check_no_unwrap.sh @@ -12,4 +12,4 @@ FILES=("components/compositing/compositor.rs" "components/compositing/pipeline.rs" "components/compositing/constellation.rs") -! grep -n "unwrap(" "${FILES[@]}" +! grep -n "unwrap(\|panic!(" "${FILES[@]}"