diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /toolkit/modules/ProfileAge.sys.mjs | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/modules/ProfileAge.sys.mjs')
-rw-r--r-- | toolkit/modules/ProfileAge.sys.mjs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/toolkit/modules/ProfileAge.sys.mjs b/toolkit/modules/ProfileAge.sys.mjs index ea824f5a91..94e991749f 100644 --- a/toolkit/modules/ProfileAge.sys.mjs +++ b/toolkit/modules/ProfileAge.sys.mjs @@ -161,6 +161,27 @@ class ProfileAgeImpl { } return Promise.resolve(undefined); } + + /** + * Record (and persist) when a backup recovery happened. We just store a + * single value - the timestamp at the time of recovery. + * + * Returns a promise that is resolved once the file has been written. + */ + recordRecoveredFromBackup(time = Date.now()) { + this._times.recoveredFromBackup = time; + return this.writeTimes(); + } + + /* Returns a promise that resolves to the time the profile was recovered from + * a backup or undefined if not recorded. + */ + get recoveredFromBackup() { + if ("recoveredFromBackup" in this._times) { + return Promise.resolve(this._times.recoveredFromBackup); + } + return Promise.resolve(undefined); + } } // A Map from profile directory to a promise that resolves to the ProfileAgeImpl. |