From 78228ee48f7999070496c0b25da18bba0d2e5e57 Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Mon, 31 Aug 2020 14:51:29 +0000 Subject: [PATCH] Bug 1662077 - QM: Replace ToResultInvoke with MOZ_TO_RESULT_INVOKE where possible; r=dom-workers-and-storage-reviewers,ttung Differential Revision: https://phabricator.services.mozilla.com/D88786 --- dom/quota/ActorsParent.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index b9da17c4ceb4..479f7568000c 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -6492,13 +6492,13 @@ nsresult QuotaManager::EnsureStorageIsInitialized() { QM_TRY(storageFile->Append(mStorageName + kSQLiteSuffix)); QM_TRY_VAR(const auto storageFileExists, - ToResultInvoke(storageFile, &nsIFile::Exists)); + MOZ_TO_RESULT_INVOKE(storageFile, Exists)); if (!storageFileExists) { QM_TRY_VAR(auto indexedDBDir, QM_NewLocalFile(mIndexedDBPath)); QM_TRY_VAR(const auto indexedDBDirExists, - ToResultInvoke(indexedDBDir, &nsIFile::Exists)); + MOZ_TO_RESULT_INVOKE(indexedDBDir, Exists)); if (indexedDBDirExists) { QM_TRY(UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory( @@ -6511,7 +6511,7 @@ nsresult QuotaManager::EnsureStorageIsInitialized() { nsLiteralString(PERSISTENT_DIRECTORY_NAME))); QM_TRY_VAR(const auto persistentStorageDirExists, - ToResultInvoke(persistentStorageDir, &nsIFile::Exists)); + MOZ_TO_RESULT_INVOKE(persistentStorageDir, Exists)); if (persistentStorageDirExists) { QM_TRY(UpgradeFromPersistentStorageDirectoryToDefaultStorageDirectory( @@ -6545,9 +6545,8 @@ nsresult QuotaManager::EnsureStorageIsInitialized() { QM_TRY(connection->ExecuteSimpleSQL("PRAGMA synchronous = EXTRA;"_ns)); // Check to make sure that the storage version is correct. - QM_TRY_VAR( - auto storageVersion, - ToResultInvoke(connection, &mozIStorageConnection::GetSchemaVersion)); + QM_TRY_VAR(auto storageVersion, + MOZ_TO_RESULT_INVOKE(connection, GetSchemaVersion)); // Hacky downgrade logic! // If we see major.minor of 3.0, downgrade it to be 2.1. @@ -6568,7 +6567,7 @@ nsresult QuotaManager::EnsureStorageIsInitialized() { QM_TRY_VAR(auto storageDir, QM_NewLocalFile(mStoragePath)); QM_TRY_VAR(const auto storageDirExists, - ToResultInvoke(storageDir, &nsIFile::Exists)); + MOZ_TO_RESULT_INVOKE(storageDir, Exists)); const bool newDirectory = !storageDirExists; @@ -6620,8 +6619,7 @@ nsresult QuotaManager::EnsureStorageIsInitialized() { } QM_TRY_VAR(storageVersion, - ToResultInvoke(connection, - &mozIStorageConnection::GetSchemaVersion)); + MOZ_TO_RESULT_INVOKE(connection, GetSchemaVersion)); } MOZ_ASSERT(storageVersion == kStorageVersion);