tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d188d8bdf2eac1dd29f998640ba40aedc6067f7e
parent d8afc77dc7ac04df294f37b46d36b0a0ef68645d
Author: Jan Varga <Jan.Varga@gmail.com>
Date:   Thu,  4 Dec 2025 15:59:57 +0000

Bug 1988590 - QM: Make PersistOp honor updateOriginAccessTime pref; r=dom-storage-reviewers,jari

Align PersistOp with SaveOriginAccessTimeOp by ensuring it also respects the
dom.quotaManager.temporaryStorage.updateOriginAccessTime pref when updating
the origin access time.

This change is not strictly required for the current bug (persisting an origin
avoids the clearing alone so the access time is then irrelevant), but the
discrepancy was identified while adding tests and could potentially cause test
debuggig issues in future. It improves correctness and consistency of access
time handling across operations.

Testing: The testing only feature is exercised in a new xpcshell test
(test_temporaryStorageCleanup.js) added in a follow-up patch for this bug.

Differential Revision: https://phabricator.services.mozilla.com/D267324

Diffstat:
Mdom/quota/OriginOperations.cpp | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dom/quota/OriginOperations.cpp b/dom/quota/OriginOperations.cpp @@ -3660,7 +3660,12 @@ nsresult PersistOp::DoDirectoryWork(QuotaManager& aQuotaManager) { // Set the persisted flag to true and also update origin access time // while we are here. - originStateMetadata.mLastAccessTime = PR_Now(); + // See the documentation for this pref in StaticPrefList.yaml + if (StaticPrefs:: + dom_quotaManager_temporaryStorage_updateOriginAccessTime()) { + originStateMetadata.mLastAccessTime = PR_Now(); + } + originStateMetadata.mPersisted = true; QM_TRY(MOZ_TO_RESULT(