Auto merge of #11749 - asajeffrey:constellation-failing-failure, r=glennw

Check to see if about:failure failed.

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11749)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-06-15 07:19:08 -05:00 committed by GitHub
commit 033786cd0d

View file

@ -907,6 +907,7 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
debug!("Panic handler for pipeline {:?}: {}.", pipeline_id, reason); debug!("Panic handler for pipeline {:?}: {}.", pipeline_id, reason);
if let Some(pipeline_id) = pipeline_id { 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 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); let window_size = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.size);
@ -923,14 +924,19 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
self.close_pipeline(pending_pipeline_id, ExitPipelineMode::Force); 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"); warn!("creating replacement pipeline for about:failure");
let new_pipeline_id = PipelineId::new(); let new_pipeline_id = PipelineId::new();
self.new_pipeline(new_pipeline_id, let load_data = LoadData::new(failure_url, None, None);
parent_info, self.new_pipeline(new_pipeline_id, parent_info, window_size, None, load_data);
window_size,
None,
LoadData::new(Url::parse("about:failure").expect("infallible"), None, None));
self.push_pending_frame(new_pipeline_id, Some(pipeline_id)); self.push_pending_frame(new_pipeline_id, Some(pipeline_id));