diff --git a/src/external-patches/firefox/issue_14990.patch b/src/external-patches/firefox/issue_14990.patch index 0a0615c9b..7f90b2a51 100644 --- a/src/external-patches/firefox/issue_14990.patch +++ b/src/external-patches/firefox/issue_14990.patch @@ -54,7 +54,7 @@ diff --git a/browser/components/sessionstore/SessionWriter.sys.mjs b/browser/com + uncompressedBytes = await IOUtils.writeJSON(this.Paths.clean, state, { tmpPath: this.Paths.clean + ".tmp", compress: true, -+ jsonLengthHint, ++ lengthHint: jsonLengthHint, }); fileStat = await IOUtils.stat(this.Paths.clean); } else if (this.state == STATE_RECOVERY) { @@ -69,7 +69,7 @@ diff --git a/browser/components/sessionstore/SessionWriter.sys.mjs b/browser/com tmpPath: this.Paths.recovery + ".tmp", backupFile: this.Paths.recoveryBackup, compress: true, -+ jsonLengthHint, ++ lengthHint: jsonLengthHint, }); fileStat = await IOUtils.stat(this.Paths.recovery); } else { @@ -80,7 +80,7 @@ diff --git a/browser/components/sessionstore/SessionWriter.sys.mjs b/browser/com + uncompressedBytes = await IOUtils.writeJSON(this.Paths.recovery, state, { tmpPath: this.Paths.recovery + ".tmp", compress: true, -+ jsonLengthHint, ++ lengthHint: jsonLengthHint, }); fileStat = await IOUtils.stat(this.Paths.recovery); } diff --git a/src/external-patches/manifest.json b/src/external-patches/manifest.json index a3b9d2613..bede642e2 100644 --- a/src/external-patches/manifest.json +++ b/src/external-patches/manifest.json @@ -45,7 +45,8 @@ "id": "D298708", "name": "Issue 14990", "replaces": { - "this._lastJsonLength = uncompressedBytes;": "this._lastJsonLength = uncompressedBytes.jsonLength;" + "this._lastJsonLength = uncompressedBytes;": "this._lastJsonLength = uncompressedBytes.jsonLength;", + " jsonLengthHint,": " lengthHint: jsonLengthHint," } } ] diff --git a/src/toolkit/modules/JSONFile-sys-mjs.patch b/src/toolkit/modules/JSONFile-sys-mjs.patch index 376848f1b..ca27e90bc 100644 --- a/src/toolkit/modules/JSONFile-sys-mjs.patch +++ b/src/toolkit/modules/JSONFile-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/toolkit/modules/JSONFile.sys.mjs b/toolkit/modules/JSONFile.sys.mjs -index 397991e4af8f49b6365d729fc11267b5c1113400..70da83a0dd7658986dfd5f52103873bbb33b3c18 100644 +index 397991e4af8f49b6365d729fc11267b5c1113400..599ed16981aa1f1e9abfee2ad6c1883efd88e0ba 100644 --- a/toolkit/modules/JSONFile.sys.mjs +++ b/toolkit/modules/JSONFile.sys.mjs @@ -132,6 +132,7 @@ export function JSONFile(config) { @@ -16,7 +16,7 @@ index 397991e4af8f49b6365d729fc11267b5c1113400..70da83a0dd7658986dfd5f52103873bb try { - await IOUtils.writeJSON( + if (this._useSizeHints && this._lastSavedSize) { -+ this._options.jsonLengthHint = Math.ceil(this._lastSavedSize * 1.05); ++ this._options.lengthHint = Math.ceil(this._lastSavedSize * 1.05); + } + const result = await IOUtils.writeJSON( this.path,