Bug 1742168, increase maxStateObjectSize to 16MB and make the pref a StaticPref, r=peterv

Keeping the pref as signed, since the existing code explicitly handles that case, so someone may have -1 as the pref value.

Differential Revision: https://phabricator.services.mozilla.com/D132020
This commit is contained in:
Olli Pettay
2021-11-30 13:31:20 +00:00
parent 0229c869bd
commit 4f846ab920
5 changed files with 40 additions and 6 deletions

View File

@@ -11114,9 +11114,7 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
}
// Check that the state object isn't too long.
// Default max length: 2097152 (0x200000) bytes.
int32_t maxStateObjSize =
Preferences::GetInt("browser.history.maxStateObjectSize", 2097152);
int32_t maxStateObjSize = StaticPrefs::browser_history_maxStateObjectSize();
if (maxStateObjSize < 0) {
maxStateObjSize = 0;
}