Skip to content

Commit

Permalink
Bug 1737860 - Make the minimum inactive duration configurable through…
Browse files Browse the repository at this point in the history
… pref. r=haik

For end-to-end testing, this value needs to be configurable.

Differential Revision: https://phabricator.services.mozilla.com/D129731
  • Loading branch information
Toshihito Kikuchi committed Oct 28, 2021
1 parent b8ddc15 commit be8b495
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ pref("security.allow_parent_unrestricted_js_loads", false);
// Unload tabs when available memory is running low
pref("browser.tabs.unloadOnLowMemory", true);

// Tab Unloader does not unload tabs whose last inactive period is longer than
// this value (in milliseconds).
pref("browser.tabs.min_inactive_duration_before_unload", 600000);

#if defined(XP_MACOSX)
// During low memory periods, poll with this frequency (milliseconds)
// until memory is no longer low. Changes to the pref take effect immediately.
Expand Down
4 changes: 3 additions & 1 deletion browser/modules/TabUnloader.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const NEVER_DISCARD = 100000;

// Default minimum inactive duration. Tabs that were accessed in the last
// period of this duration are not unloaded.
const kMinInactiveDurationInMs = 600000; // ten minutes
const kMinInactiveDurationInMs = Services.prefs.getIntPref(
"browser.tabs.min_inactive_duration_before_unload"
);

let criteriaTypes = [
["isNonDiscardable", NEVER_DISCARD],
Expand Down

0 comments on commit be8b495

Please sign in to comment.