mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Fix panics in the script_task memory reporter.
These are caused by page_root being empty.
This commit is contained in:
parent
d90907cb5f
commit
97e3b24aa6
1 changed files with 17 additions and 14 deletions
|
@ -1188,7 +1188,9 @@ impl ScriptTask {
|
|||
let mut urls = vec![];
|
||||
let mut dom_tree_size = 0;
|
||||
let mut reports = vec![];
|
||||
for it_page in self.root_page().iter() {
|
||||
|
||||
if let Some(root_page) = self.page.borrow().as_ref() {
|
||||
for it_page in root_page.iter() {
|
||||
let current_url = it_page.document().url().serialize();
|
||||
urls.push(current_url.clone());
|
||||
|
||||
|
@ -1206,6 +1208,7 @@ impl ScriptTask {
|
|||
size: dom_tree_size,
|
||||
})
|
||||
}
|
||||
}
|
||||
let path_seg = format!("url({})", urls.join(", "));
|
||||
reports.extend(ScriptTask::get_reports(self.get_cx(), path_seg));
|
||||
reports_chan.send(reports);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue