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:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user