Bug 1913624 - Remove expired telemetry histogram HOVER_UNTIL_UNSELECTED_TAB_OPENED, r=chutten,tabbrowser-reviewers,dao.

Depends on D219440

Differential Revision: https://phabricator.services.mozilla.com/D219441
This commit is contained in:
Florian Quèze
2024-08-20 10:26:51 +00:00
parent 171499434e
commit 65bf72cdca
3 changed files with 2 additions and 64 deletions

View File

@@ -578,7 +578,6 @@
this.container._handleTabSelect();
} else if (this.linkedPanel) {
this.linkedBrowser.unselectedTabHover(true);
this.startUnselectedTabHoverTimer();
}
// Prepare connection to host beforehand.
@@ -594,7 +593,6 @@
this._hover = false;
if (this.linkedPanel && !this.selected) {
this.linkedBrowser.unselectedTabHover(false);
this.cancelUnselectedTabHoverTimer();
}
this.dispatchEvent(new CustomEvent("TabHoverEnd", { bubbles: true }));
}
@@ -620,51 +618,6 @@
// TODO(Itiel): Maybe simplify this when bug 1830989 lands
}
startUnselectedTabHoverTimer() {
// Only record data when we need to.
if (!this.linkedBrowser.shouldHandleUnselectedTabHover) {
return;
}
if (
!TelemetryStopwatch.running("HOVER_UNTIL_UNSELECTED_TAB_OPENED", this)
) {
TelemetryStopwatch.start("HOVER_UNTIL_UNSELECTED_TAB_OPENED", this);
}
if (this._hoverTabTimer) {
clearTimeout(this._hoverTabTimer);
this._hoverTabTimer = null;
}
}
cancelUnselectedTabHoverTimer() {
// Since we're listening "mouseout" event, instead of "mouseleave".
// Every time the cursor is moving from the tab to its child node (icon),
// it would dispatch "mouseout"(for tab) first and then dispatch
// "mouseover" (for icon, eg: close button, speaker icon) soon.
// It causes we would cancel present TelemetryStopwatch immediately
// when cursor is moving on the icon, and then start a new one.
// In order to avoid this situation, we could delay cancellation and
// remove it if we get "mouseover" within very short period.
this._hoverTabTimer = setTimeout(() => {
if (
TelemetryStopwatch.running("HOVER_UNTIL_UNSELECTED_TAB_OPENED", this)
) {
TelemetryStopwatch.cancel("HOVER_UNTIL_UNSELECTED_TAB_OPENED", this);
}
}, 100);
}
finishUnselectedTabHoverTimer() {
// Stop timer when the tab is opened.
if (
TelemetryStopwatch.running("HOVER_UNTIL_UNSELECTED_TAB_OPENED", this)
) {
TelemetryStopwatch.finish("HOVER_UNTIL_UNSELECTED_TAB_OPENED", this);
}
}
resumeDelayedMedia() {
if (this.activeMediaBlocked) {
this.removeAttribute("activemedia-blocked");

View File

@@ -1358,11 +1358,8 @@
newTab.attention = false;
// The tab has been selected, it's not unselected anymore.
// (1) Call the current tab's finishUnselectedTabHoverTimer()
// to save a telemetry record.
// (2) Call the current browser's unselectedTabHover() with false
// to dispatch an event.
newTab.finishUnselectedTabHoverTimer();
// Call the current browser's unselectedTabHover() with false
// to dispatch an event.
newBrowser.unselectedTabHover(false);
}

View File

@@ -15763,18 +15763,6 @@
"n_values": 20,
"description": "Cumulative no. bookmark of searches performed before selecting a link."
},
"HOVER_UNTIL_UNSELECTED_TAB_OPENED": {
"record_in_processes": ["main"],
"products": ["firefox", "fennec"],
"alert_emails": ["alwu@mozilla.com"],
"expires_in_version": "60",
"kind": "exponential",
"high": 10000,
"n_buckets": 100,
"bug_numbers": [1274919],
"description": "Measure the time how long the cursor is hovering before opening the unselcted tab. Only record the data if someone requests for sending unselected tab hover msg.",
"releaseChannelCollection": "opt-out"
},
"WEBVR_USERS_VIEW_IN": {
"record_in_processes": ["main", "gpu", "content"],
"products": ["firefox", "fennec"],