From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../resources/SessionStoreBackupResource.sys.mjs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'browser/components/backup/resources/SessionStoreBackupResource.sys.mjs') diff --git a/browser/components/backup/resources/SessionStoreBackupResource.sys.mjs b/browser/components/backup/resources/SessionStoreBackupResource.sys.mjs index fa5dcca848..d28598944f 100644 --- a/browser/components/backup/resources/SessionStoreBackupResource.sys.mjs +++ b/browser/components/backup/resources/SessionStoreBackupResource.sys.mjs @@ -28,6 +28,32 @@ export class SessionStoreBackupResource extends BackupResource { return false; } + async backup(stagingPath, profilePath = PathUtils.profileDir) { + let sessionStoreState = lazy.SessionStore.getCurrentState(true); + let sessionStorePath = PathUtils.join(stagingPath, "sessionstore.jsonlz4"); + + /* Bug 1891854 - remove cookies from session store state if the backup file is + * not encrypted. */ + + await IOUtils.writeJSON(sessionStorePath, sessionStoreState, { + compress: true, + }); + await BackupResource.copyFiles(profilePath, stagingPath, [ + "sessionstore-backups", + ]); + + return null; + } + + async recover(_manifestEntry, recoveryPath, destProfilePath) { + await BackupResource.copyFiles(recoveryPath, destProfilePath, [ + "sessionstore.jsonlz4", + "sessionstore-backups", + ]); + + return null; + } + async measure(profilePath = PathUtils.profileDir) { // Get the current state of the session store JSON and // measure it's uncompressed size. -- cgit v1.2.3