mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1693741 - Retry removing or renaming of origin directories in StorageOperationBase::MaybeRenameOrigin; r=dom-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D105733
This commit is contained in:
parent
e24a1a0c30
commit
c3fd525400
@ -9679,12 +9679,18 @@ Result<bool, nsresult> StorageOperationBase::MaybeRenameOrigin(
|
||||
"instead of renaming!",
|
||||
NS_ConvertUTF16toUTF8(oldLeafName).get(),
|
||||
NS_ConvertUTF16toUTF8(newLeafName).get());
|
||||
|
||||
QM_TRY(aOriginProps.mDirectory->Remove(/* recursive */ true));
|
||||
} else {
|
||||
QM_TRY(aOriginProps.mDirectory->RenameTo(nullptr, newLeafName));
|
||||
}
|
||||
|
||||
QM_TRY(CallWithDelayedRetriesIfAccessDenied(
|
||||
[&exists, &aOriginProps, &newLeafName] {
|
||||
if (exists) {
|
||||
QM_TRY_RETURN(aOriginProps.mDirectory->Remove(/* recursive */ true));
|
||||
}
|
||||
QM_TRY_RETURN(aOriginProps.mDirectory->RenameTo(nullptr, newLeafName));
|
||||
},
|
||||
StaticPrefs::dom_quotaManager_directoryRemovalOrRenaming_maxRetries(),
|
||||
StaticPrefs::dom_quotaManager_directoryRemovalOrRenaming_delayMs()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2557,6 +2557,23 @@
|
||||
mirror: always
|
||||
#endif
|
||||
|
||||
# How many times we should retry directory removal or renaming if access was
|
||||
# denied?
|
||||
- name: dom.quotaManager.directoryRemovalOrRenaming.maxRetries
|
||||
type: RelaxedAtomicUint32
|
||||
#ifdef XP_WIN
|
||||
value: 10
|
||||
#else
|
||||
value: 0
|
||||
#endif
|
||||
mirror: always
|
||||
|
||||
# How long we should wait between retries (in milliseconds)?
|
||||
- name: dom.quotaManager.directoryRemovalOrRenaming.delayMs
|
||||
type: RelaxedAtomicUint32
|
||||
value: 200
|
||||
mirror: always
|
||||
|
||||
# Reporting API.
|
||||
- name: dom.reporting.enabled
|
||||
type: RelaxedAtomicBool
|
||||
|
Loading…
Reference in New Issue
Block a user