gecko-dev/mobile
Jan Henning 7178e9149d Bug 1499874 - Part 3: Renumber recently closed tabs from the previous session when automatically restoring. r=esawin
We want to remove recently closed tabs from the session store when they get re-
stored again, and for that we need something to uniquely identify them.
As tab IDs are unique per session only, this means that the tab IDs of recently
closed tabs resurrected from the previous session could conflict with tabs that
have been freshly opened in the current session.

E.g. tab 2 has been closed in a previous session and is now part of the session
store's closed tab list. In the current session, a number of tabs are opened
again and then what is now the *current* tab 2 is closed as well. The result
would be that the session store now has two closed tabs with a tab ID of 2.

To avoid that scenario, all recently closed tabs are renumbered with an ID in
the negative range at the start of the session. Therefore all tabs originally
opened in the current session will have a tab ID >= 0, while all recently closed
tabs coming directly from a previous session will have a negative tab ID, < -1.
(-1 itself remains the sentinel value for an invalid tab ID).

Differential Revision: https://phabricator.services.mozilla.com/D15331

--HG--
extra : source : 971ebdae024e188a913d2eda452a7761b4b38d1b
extra : histedit_source : b04ac438d2d7325d35e300946fcdb2a385b1598c
2018-12-23 17:23:21 +01:00
..
android Bug 1499874 - Part 3: Renumber recently closed tabs from the previous session when automatically restoring. r=esawin 2018-12-23 17:23:21 +01:00
locales Bug 1507595 - Test fixes. r=flod,Gijs 2018-12-28 19:40:33 +00:00