forked from mirrors/gecko-dev
Bug 1652613 - record whether the user switched away from the tab while it was hung, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D84343
This commit is contained in:
parent
02d23145dc
commit
eabaeb4c02
2 changed files with 14 additions and 1 deletions
|
|
@ -432,6 +432,7 @@ var ProcessHangMonitor = {
|
||||||
{
|
{
|
||||||
end_reason: endReason,
|
end_reason: endReason,
|
||||||
hang_duration: "" + hangDuration,
|
hang_duration: "" + hangDuration,
|
||||||
|
n_tab_deselect: "" + info.deselectCount,
|
||||||
uri_type,
|
uri_type,
|
||||||
uptime,
|
uptime,
|
||||||
wait_count: "" + info.waitCount,
|
wait_count: "" + info.waitCount,
|
||||||
|
|
@ -638,8 +639,18 @@ var ProcessHangMonitor = {
|
||||||
|
|
||||||
// If a new tab is selected or if a tab changes remoteness, then
|
// If a new tab is selected or if a tab changes remoteness, then
|
||||||
// we may need to show or hide a hang notification.
|
// we may need to show or hide a hang notification.
|
||||||
|
|
||||||
if (event.type == "TabSelect" || event.type == "TabRemotenessChange") {
|
if (event.type == "TabSelect" || event.type == "TabRemotenessChange") {
|
||||||
|
if (event.type == "TabSelect" && event.detail.previousTab) {
|
||||||
|
// If we've got a notification, check the previous tab's report and
|
||||||
|
// indicate the user switched tabs while the notification was up.
|
||||||
|
let r =
|
||||||
|
this.findActiveReport(event.detail.previousTab.linkedBrowser) ||
|
||||||
|
this.findPausedReport(event.detail.previousTab.linkedBrowser);
|
||||||
|
if (r) {
|
||||||
|
let info = this._activeReports.get(r) || this._pausedReports.get(r);
|
||||||
|
info.deselectCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.updateWindow(win);
|
this.updateWindow(win);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -684,6 +695,7 @@ var ProcessHangMonitor = {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._activeReports.set(report, {
|
this._activeReports.set(report, {
|
||||||
|
deselectCount: 0,
|
||||||
lastReportFromChild: now,
|
lastReportFromChild: now,
|
||||||
waitCount: 0,
|
waitCount: 0,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2294,6 +2294,7 @@ slow_script_warning:
|
||||||
end_reason: Why the warning was hidden (user action, the process becoming responsive again, the browser quitting, etc.)
|
end_reason: Why the warning was hidden (user action, the process becoming responsive again, the browser quitting, etc.)
|
||||||
wait_count: How many times the user elected to wait.
|
wait_count: How many times the user elected to wait.
|
||||||
hang_duration: How long we believe the hang continued (ms).
|
hang_duration: How long we believe the hang continued (ms).
|
||||||
|
n_tab_deselect: How many times the user switched away from a tab affected by this hang.
|
||||||
uri_type: The kind of script URL that hung.
|
uri_type: The kind of script URL that hung.
|
||||||
uptime: How long the notification was up (ms).
|
uptime: How long the notification was up (ms).
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue