Bug 1878841 - Add support for pausing IndexedDB connection thread during connection idle maintenance; r=dom-storage-reviewers,jari

Differential Revision: https://phabricator.services.mozilla.com/D200780
This commit is contained in:
Jan Varga
2024-02-27 17:18:15 +00:00
parent fc9d189f21
commit d22f86b67e
2 changed files with 13 additions and 0 deletions

View File

@@ -6933,6 +6933,12 @@ Result<bool, nsresult> DatabaseConnection::ReclaimFreePagesWhileIdle(
AUTO_PROFILER_LABEL("DatabaseConnection::ReclaimFreePagesWhileIdle", DOM);
uint32_t pauseOnConnectionThreadMs = StaticPrefs::
dom_indexedDB_connectionIdleMaintenance_pauseOnConnectionThreadMs();
if (pauseOnConnectionThreadMs > 0) {
PR_Sleep(PR_MillisecondsToInterval(pauseOnConnectionThreadMs));
}
// Make sure we don't keep working if anything else needs this thread.
nsIThread* currentThread = NS_GetCurrentThread();
MOZ_ASSERT(currentThread);

View File

@@ -2754,6 +2754,13 @@
value: true
mirror: always
# A pref that is used to slow down connection idle maintenance for testing
# purposes.
- name: dom.indexedDB.connectionIdleMaintenance.pauseOnConnectionThreadMs
type: RelaxedAtomicUint32
value: 0
mirror: always
# Whether or not indexedDB test mode is enabled.
- name: dom.indexedDB.testing
type: RelaxedAtomicBool