Files
tubestation/browser/components
Rob Wu 2004e55a76 Bug 1959713 - Expose tabs.Tab.groupId r=zombie,dao,tabbrowser-reviewers,frontend-codestyle-reviewers
This patch exposes a groupId field on tabs.Tab objects in extensions.

On mobile (Android), the value is always -1.

On desktop, the value is the numeric representation composed from the
internal ID, which happens to fit in a safe integer. As long as the
browser is not running past year 2255, this works. As a fallback,
when an ID in a different format is encountered, the logic falls back
to returning a new unique ID based on a counter. This ID is then
stored in an internal in-memory map to maintain stable consistency.
Since it is unclear when exactly it is safe to discard this value, this
map is never cleared. This minor memory leak is acceptable because it
does not happen in practice, and even if it does, the number of tab
groups over the lifetime of a Firefox session is not going to reach
excessive values.

Differential Revision: https://phabricator.services.mozilla.com/D245159
2025-04-11 23:07:15 +00:00
..