Bug 1701346 - IDB: Revert QM_OR_ELSE_WARN to ordinary orElse in QuotaClient::GetUsageForOriginInternal; r=asuth,dom-storage-reviewers,jstutte
authorJan Varga <jvarga@mozilla.com>
Sat, 27 Mar 2021 13:08:07 +0000
changeset 573388 863ab090e28acc62e94caa6c199c7f9dcd395031
parent 573387 5ca109977007d9aee2ed2ba162b0b0474f892f5d
child 573389 6c1a2d9d4334dd0c28196e817c3d17cc0b3b4ef3
push id139645
push userjstutte@mozilla.com
push dateSat, 27 Mar 2021 13:10:33 +0000
treeherderautoland@6c1a2d9d4334 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth, dom-storage-reviewers, jstutte
bugs1701346
milestone89.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 - IDB: Revert QM_OR_ELSE_WARN to ordinary orElse in QuotaClient::GetUsageForOriginInternal; r=asuth,dom-storage-reviewers,jstutte Differential Revision: https://phabricator.services.mozilla.com/D109991
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -12864,25 +12864,27 @@ nsresult QuotaClient::GetUsageForOriginI
         *aUsageInfo += DatabaseUsageType(Some(uint64_t(fileSize)));
       }
 
       {
         IDB_TRY_INSPECT(const auto& walFile,
                         CloneFileAndAppend(
                             *directory, databaseFilename + kSQLiteWALSuffix));
 
-        IDB_TRY_INSPECT(
-            const int64_t& walFileSize,
-            QM_OR_ELSE_WARN(MOZ_TO_RESULT_INVOKE(walFile, GetFileSize),
-                            ([](const nsresult rv) {
+        // QM_OR_ELSE_WARN is not used here since we want to ignore
+        // NS_ERROR_FILE_NOT_FOUND/NS_ERROR_FILE_TARGET_DOES_NOT_EXIST
+        // completely (the -wal file doesn't have to exist).
+        IDB_TRY_INSPECT(const int64_t& walFileSize,
+                        MOZ_TO_RESULT_INVOKE(walFile, GetFileSize)
+                            .orElse([](const nsresult rv) {
                               return (rv == NS_ERROR_FILE_NOT_FOUND ||
                                       rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
                                          ? Result<int64_t, nsresult>{0}
                                          : Err(rv);
-                            })));
+                            }));
         MOZ_ASSERT(walFileSize >= 0);
         *aUsageInfo += DatabaseUsageType(Some(uint64_t(walFileSize)));
       }
 
       {
         IDB_TRY_INSPECT(const auto& fileUsage,
                         FileManager::GetUsage(fmDirectory));