Bug 1701346 - QM: Add a comment for QM_OR_ELSE_WARN in CreateOrUpgradeDirectoryMetadataHelper::MaybeUpgradeOriginDirectory; r=asuth,dom-storage-reviewers,jstutte
authorJan Varga <jvarga@mozilla.com>
Sat, 24 Apr 2021 08:58:31 +0000
changeset 577307 238e28e08f352407cbf8767951c11f3e19912bf5
parent 577306 0d9c5f03b8b04a51c6b383c2a9ce2cd85be3ac23
child 577308 6c58b606570e7a6c1b62503d4c6a9a6ccb4f03b1
push id141828
push userjvarga@mozilla.com
push dateSat, 24 Apr 2021 09:01:07 +0000
treeherderautoland@e32570129605 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, dom-storage-reviewers, jstutte
bugs1701346
milestone90.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1701346 - QM: Add a comment for QM_OR_ELSE_WARN in CreateOrUpgradeDirectoryMetadataHelper::MaybeUpgradeOriginDirectory; r=asuth,dom-storage-reviewers,jstutte Depends on D113066 Differential Revision: https://phabricator.services.mozilla.com/D113067
dom/quota/ActorsParent.cpp
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -10547,16 +10547,20 @@ nsresult CreateOrUpgradeDirectoryMetadat
 
     nsString idbDirectoryName;
     QM_TRY(OkIf(Client::TypeToText(Client::IDB, idbDirectoryName, fallible)),
            NS_ERROR_FAILURE);
 
     QM_TRY_INSPECT(const auto& idbDirectory,
                    CloneFileAndAppend(*aDirectory, idbDirectoryName));
 
+    // Usually we don't use QM_OR_ELSE_WARN with Create and
+    // NS_ERROR_FILE_ALREADY_EXISTS check, but normally the idb directory
+    // shouldn't exist during the upgrade and the upgrade normally runs only
+    // once.
     QM_TRY(QM_OR_ELSE_WARN(
         ToResult(idbDirectory->Create(nsIFile::DIRECTORY_TYPE, 0755)),
         ([&idbDirectory](const nsresult rv) -> Result<Ok, nsresult> {
           if (rv == NS_ERROR_FILE_ALREADY_EXISTS) {
             QM_TRY_INSPECT(const bool& isDirectory,
                            MOZ_TO_RESULT_INVOKE(idbDirectory, IsDirectory));
 
             QM_TRY(OkIf(isDirectory), Err(NS_ERROR_UNEXPECTED));