Skip to content

Commit 99a1108

Browse files
committed
Backed out changeset 0d228f1cfc6f (bug 1848459) for failures on browser_closed_tabs_closed_windows. CLOSED TREE
1 parent 434595b commit 99a1108

File tree

3 files changed

+3
-44
lines changed

3 files changed

+3
-44
lines changed

browser/components/sessionstore/SessionStore.sys.mjs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,7 @@ var SessionStoreInternal = {
23602360
// It's possible that a tab switched its privacy state at some point
23612361
// before our flush, so we need to filter again.
23622362
lazy.PrivacyFilter.filterPrivateTabs(winData);
2363-
this.maybeSaveClosedWindow(winData, isLastWindow, true);
2363+
this.maybeSaveClosedWindow(winData, isLastWindow);
23642364

23652365
if (!isLastWindow && winData.closedId > -1) {
23662366
this._addClosedAction(
@@ -2439,7 +2439,7 @@ var SessionStoreInternal = {
24392439
* to call this method again asynchronously (for example, after
24402440
* a window flush).
24412441
*/
2442-
maybeSaveClosedWindow(winData, isLastWindow, recordTelemetry = false) {
2442+
maybeSaveClosedWindow(winData, isLastWindow) {
24432443
// Make sure SessionStore is still running, and make sure that we
24442444
// haven't chosen to forget this window.
24452445
if (
@@ -2498,14 +2498,6 @@ var SessionStoreInternal = {
24982498
}
24992499
if (alreadyStored) {
25002500
this._removeClosedWindow(winIndex);
2501-
return;
2502-
}
2503-
// we only do this after the TabStateFlusher promise resolves in ssi_onClose
2504-
if (recordTelemetry) {
2505-
let closedTabsHistogram = Services.telemetry.getHistogramById(
2506-
"FX_SESSION_RESTORE_CLOSED_TABS_NOT_SAVED"
2507-
);
2508-
closedTabsHistogram.add(winData._closedTabs.length);
25092501
}
25102502
}
25112503
}

browser/components/sessionstore/test/browser_closed_tabs_closed_windows.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* This Source Code Form is subject to the terms of the Mozilla Public
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4-
const { TelemetryTestUtils } = ChromeUtils.import(
5-
"resource://testing-common/TelemetryTestUtils.jsm"
6-
);
4+
75
const TEST_URLS = [
86
"http://mochi.test:8888/browser/",
97
"https://www.example.com/",
@@ -76,37 +74,17 @@ async function prepareClosedData() {
7674
closedIds.tab5 =
7775
SessionStore.getClosedTabDataForWindow(privateWin)[0].closedId;
7876

79-
const testWindow6 = await BrowserTestUtils.openNewBrowserWindow();
80-
81-
const testWindow7 = await BrowserTestUtils.openNewBrowserWindow();
82-
await openAndCloseTab(testWindow7, TEST_URLS[4]);
83-
84-
let closedTabsHistogram = Services.telemetry.getHistogramById(
85-
"FX_SESSION_RESTORE_CLOSED_TABS_NOT_SAVED"
86-
);
87-
8877
await BrowserTestUtils.closeWindow(testWindow1);
8978
closedIds.testWindow1 = SessionStore.getClosedWindowData()[0].closedId;
9079
await BrowserTestUtils.closeWindow(testWindow2);
91-
9280
closedIds.testWindow2 = SessionStore.getClosedWindowData()[0].closedId;
9381
await BrowserTestUtils.closeWindow(testWindow3);
94-
9582
closedIds.testWindow3 = SessionStore.getClosedWindowData()[0].closedId;
9683
await BrowserTestUtils.closeWindow(privateWin);
9784
Assert.ok(
9885
closedIds.testWindow2 > closedIds.testWindow1,
9986
"We got the closedIds in the expected order"
10087
);
101-
102-
await BrowserTestUtils.closeWindow(testWindow6);
103-
TelemetryTestUtils.assertHistogram(closedTabsHistogram, 0, 1);
104-
closedTabsHistogram.clear();
105-
106-
await BrowserTestUtils.closeWindow(testWindow7);
107-
TelemetryTestUtils.assertHistogram(closedTabsHistogram, 1, 1);
108-
closedTabsHistogram.clear();
109-
11088
return closedIds;
11189
}
11290

toolkit/components/telemetry/Histograms.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9307,17 +9307,6 @@
93079307
"n_values": 50,
93089308
"description": "Session restore: Number of tabs restored eagerly in the session that has just been restored."
93099309
},
9310-
"FX_SESSION_RESTORE_CLOSED_TABS_NOT_SAVED": {
9311-
"record_in_processes": ["main", "content"],
9312-
"products": ["firefox"],
9313-
"expires_in_version": "127",
9314-
"alert_emails": ["firefox-view-engineers@mozilla.com"],
9315-
"releaseChannelCollection": "opt-out",
9316-
"bug_numbers": [1848459],
9317-
"kind": "enumerated",
9318-
"n_values": 25,
9319-
"description": "Session restore: Number of closed tabs that are NOT saved due to lack of open tabs worth saving on window close."
9320-
},
93219310
"FX_TABLETMODE_PAGE_LOAD": {
93229311
"record_in_processes": ["main", "content"],
93239312
"products": ["firefox", "fennec"],

0 commit comments

Comments
 (0)