servo: Merge #11749 - Check to see if about:failure failed (from asajeffrey:constellation-failing-failure); r=glennw
authorAlan Jeffrey <ajeffrey@mozilla.com>
Wed, 15 Jun 2016 07:19:08 -0500
changeset 339077 eae592d8696190767af6ec717c9b374a5b9b43e0
parent 339076 8e85e0e587b579e66fe657a7d768263e5d5186d0
child 339078 4ecaccffbf97bfa8cc1a60d696f6aa5a03394ffd
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglennw
servo: Merge #11749 - Check to see if about:failure failed (from asajeffrey:constellation-failing-failure); r=glennw <!-- Please describe your changes on the following line: --> Check to see if about:failure is failing, --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11747 - [X] These changes do not require tests because we're not testing panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 033786cd0dd0f74b5e2974aa67e000b832f17d17
servo/components/constellation/constellation.rs
--- a/servo/components/constellation/constellation.rs
+++ b/servo/components/constellation/constellation.rs
@@ -902,40 +902,46 @@ impl<Message, LTF, STF> Constellation<Me
             // Hard fail exists for test runners so we crash and that's good enough.
             error!("Pipeline failed in hard-fail mode.  Crashing!");
             process::exit(1);
         }
 
         debug!("Panic handler for pipeline {:?}: {}.", pipeline_id, reason);
 
         if let Some(pipeline_id) = pipeline_id {
+            let pipeline_url = self.pipelines.get(&pipeline_id).map(|pipeline| pipeline.url.clone());
             let parent_info = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.parent_info);
             let window_size = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.size);
 
             // Notify the browser chrome that the pipeline has failed
             self.trigger_mozbrowsererror(pipeline_id, reason, backtrace);
 
             self.close_pipeline(pipeline_id, ExitPipelineMode::Force);
             self.pipelines.remove(&pipeline_id);
 
             while let Some(pending_pipeline_id) = self.pending_frames.iter().find(|pending| {
                 pending.old_pipeline_id == Some(pipeline_id)
             }).map(|frame| frame.new_pipeline_id) {
                 warn!("removing pending frame change for failed pipeline");
                 self.close_pipeline(pending_pipeline_id, ExitPipelineMode::Force);
             }
 
+            let failure_url = Url::parse("about:failure").expect("infallible");
+
+            if let Some(pipeline_url) = pipeline_url {
+                if pipeline_url == failure_url {
+                    return error!("about:failure failed");
+                }
+            }
+
             warn!("creating replacement pipeline for about:failure");
 
             let new_pipeline_id = PipelineId::new();
-            self.new_pipeline(new_pipeline_id,
-                              parent_info,
-                              window_size,
-                              None,
-                              LoadData::new(Url::parse("about:failure").expect("infallible"), None, None));
+            let load_data = LoadData::new(failure_url, None, None);
+            self.new_pipeline(new_pipeline_id, parent_info, window_size, None, load_data);
 
             self.push_pending_frame(new_pipeline_id, Some(pipeline_id));
 
         }
 
         self.handled_panic = true;
     }