Bug 1910848 - Add support for pausing QM IO thread after finishing directory work; r=dom-storage-reviewers,hsingh,asuth

Differential Revision: https://phabricator.services.mozilla.com/D194176
This commit is contained in:
Jan Varga 2024-08-07 07:53:15 +00:00
Родитель 52eedfef26
Коммит 103fa3cf0f
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -8,6 +8,7 @@
#include "mozilla/Assertions.h"
#include "mozilla/MozPromise.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/dom/fs/TargetPtrHolder.h"
#include "mozilla/dom/quota/OriginOperationCallbacks.h"
#include "mozilla/dom/quota/QuotaManager.h"
@ -98,6 +99,12 @@ void OriginOperationBase::RunImmediately() {
*selfHolder->mQuotaManager)),
CreateAndRejectBoolPromise);
uint32_t pauseOnIOThreadMs = StaticPrefs::
dom_quotaManager_originOperations_pauseOnIOThreadMs();
if (pauseOnIOThreadMs > 0) {
PR_Sleep(PR_MillisecondsToInterval(pauseOnIOThreadMs));
}
return BoolPromise::CreateAndResolve(true, __func__);
})
->Then(

Просмотреть файл

@ -3473,6 +3473,12 @@
value: -1
mirror: always
# A pref that is used to slow down origin operations for testing purposes.
- name: dom.quotaManager.originOperations.pauseOnIOThreadMs
type: RelaxedAtomicUint32
value: 0
mirror: always
# A pref that is used to enable testing features.
- name: dom.quotaManager.testing
type: SequentiallyConsistentAtomicBool