From 0acd64c6914a4e2135e8406abc61cdb41090a962 Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Mon, 7 Sep 2020 12:24:50 +0000 Subject: [PATCH] Bug 1662119 - Replace MOZ_TRY with IDB_TRY; r=dom-workers-and-storage-reviewers,sg Differential Revision: https://phabricator.services.mozilla.com/D88832 --- dom/indexedDB/ActorsParent.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index a87fa776f436..ba470c580c1c 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -16336,9 +16336,7 @@ nsresult FileManager::Init(nsIFile* aDirectory, std::mem_fn(&mozIStorageConnection::CreateStatement), aConnection, "SELECT id, refcount FROM file"_ns)); - // XXX gcc doesn't like multiple IDB_TRY_VAR within a macro, so can't use - // MOZ_TRY directly here. - auto res = CollectWhile( + IDB_TRY(CollectWhile( [&stmt]() -> Result { IDB_TRY_VAR(auto hasResult, MOZ_TO_RESULT_INVOKE(stmt, ExecuteStep)); return hasResult; @@ -16359,8 +16357,7 @@ nsresult FileManager::Init(nsIFile* aDirectory, mLastFileId = std::max(id, mLastFileId); return mozilla::Ok{}; - }); - MOZ_TRY(std::move(res)); + })); return NS_OK; } @@ -16509,7 +16506,7 @@ nsresult FileManager::InitDirectory(nsIFile& aDirectory, nsIFile& aDatabaseFile, bool hasJournals = false; - MOZ_TRY(CollectEach( + IDB_TRY(CollectEach( [&entries]() -> Result, nsresult> { IDB_TRY_VAR( auto file, @@ -16564,9 +16561,7 @@ nsresult FileManager::InitDirectory(nsIFile& aDirectory, nsIFile& aDatabaseFile, IDB_TRY(stmt->BindStringByIndex(0, path)); - // XXX gcc doesn't like multiple IDB_TRY_VAR within a macro, so can't use - // MOZ_TRY directly here. - auto res = CollectWhile( + IDB_TRY(CollectWhile( [&stmt]() -> Result { IDB_TRY_VAR(auto hasResult, MOZ_TO_RESULT_INVOKE(stmt, ExecuteStep)); @@ -16608,8 +16603,7 @@ nsresult FileManager::InitDirectory(nsIFile& aDirectory, nsIFile& aDatabaseFile, } return mozilla::Ok{}; - }); - MOZ_TRY(std::move(res)); + })); IDB_TRY(connection->ExecuteSimpleSQL("DROP TABLE fs;"_ns)); IDB_TRY(transaction.Commit()); @@ -16636,8 +16630,7 @@ Result FileManager::GetUsage(nsIFile* aDirectory) { FileUsageType usage; - nsCOMPtr file; - MOZ_TRY(CollectEach( + IDB_TRY(CollectEach( [&entries]() -> Result, nsresult> { IDB_TRY_VAR( auto file,