Bug 1728267 - Remove implicit ToResult from QM_TRY when no extra argument is passed in dom/indexedDB; r=dom-storage-reviewers,jstutte,jari

Differential Revision: https://phabricator.services.mozilla.com/D125318
This commit is contained in:
Jan Varga 2021-09-24 13:08:30 +00:00
Родитель d512bd65af
Коммит 590fd74ae2
7 изменённых файлов: 569 добавлений и 495 удалений

Просмотреть файл

@ -2784,12 +2784,12 @@ nsresult BackgroundRequestChild::PreprocessHelper::ProcessStream() {
blobInputStream->GetInternalStream();
MOZ_ASSERT(internalInputStream);
QM_TRY(
SnappyUncompressStructuredCloneData(*internalInputStream, *mCloneData));
QM_TRY(MOZ_TO_RESULT(
SnappyUncompressStructuredCloneData(*internalInputStream, *mCloneData)));
mState = State::Finishing;
QM_TRY(mOwningEventTarget->Dispatch(this, NS_DISPATCH_NORMAL));
QM_TRY(MOZ_TO_RESULT(mOwningEventTarget->Dispatch(this, NS_DISPATCH_NORMAL)));
return NS_OK;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -325,13 +325,14 @@ nsresult ReadCompressedIndexDataValuesFromSource(
// we also can't use QM_TRY_UNWRAP/QM_TRY_INSPECT here.
const uint8_t* blobData;
uint32_t blobDataLength;
QM_TRY(aSource.GetSharedBlob(aColumnIndex, &blobDataLength, &blobData));
QM_TRY(MOZ_TO_RESULT(
aSource.GetSharedBlob(aColumnIndex, &blobDataLength, &blobData)));
QM_TRY(OkIf(blobDataLength), NS_ERROR_FILE_CORRUPTED,
IDB_REPORT_INTERNAL_ERR_LAMBDA);
QM_TRY(ReadCompressedIndexDataValuesFromBlob(
Span(blobData, blobDataLength), aOutIndexValues));
QM_TRY(MOZ_TO_RESULT(ReadCompressedIndexDataValuesFromBlob(
Span(blobData, blobDataLength), aOutIndexValues)));
return NS_OK;
}
@ -436,7 +437,8 @@ GetStructuredCloneReadInfoFromExternalBlob(
return fileInputStream;
}));
QM_TRY(SnappyUncompressStructuredCloneData(*fileInputStream, data));
QM_TRY(MOZ_TO_RESULT(
SnappyUncompressStructuredCloneData(*fileInputStream, data)));
}
return StructuredCloneReadInfoParent{std::move(data), std::move(files),
@ -480,7 +482,8 @@ GetStructuredCloneReadInfoFromSource(T* aSource, uint32_t aDataIndex,
case mozIStorageStatement::VALUE_TYPE_BLOB: {
const uint8_t* blobData;
uint32_t blobDataLength;
QM_TRY(aSource->GetSharedBlob(aDataIndex, &blobDataLength, &blobData));
QM_TRY(MOZ_TO_RESULT(
aSource->GetSharedBlob(aDataIndex, &blobDataLength, &blobData)));
return GetStructuredCloneReadInfoFromBlob(
blobData, blobDataLength, aFileManager, fileIds, aMaybeKey);
@ -721,7 +724,7 @@ nsresult ExecuteSimpleSQLSequence(mozIStorageConnection& aConnection,
const auto extraInfo = quota::ScopedLogExtraInfo{
quota::ScopedLogExtraInfo::kTagQuery, aSQLCommand};
QM_TRY(aConnection.ExecuteSimpleSQL(aSQLCommand));
QM_TRY(MOZ_TO_RESULT(aConnection.ExecuteSimpleSQL(aSQLCommand)));
}
return NS_OK;

Просмотреть файл

@ -68,7 +68,7 @@ nsresult CreateFileTables(mozIStorageConnection& aConnection) {
"DELETE FROM file WHERE id = OLD.id; "
"END;"_ns};
QM_TRY(ExecuteSimpleSQLSequence(aConnection, commands));
QM_TRY(MOZ_TO_RESULT(ExecuteSimpleSQLSequence(aConnection, commands)));
return NS_OK;
}
@ -160,11 +160,11 @@ nsresult CreateTables(mozIStorageConnection& aConnection) {
"ON unique_index_data (index_id, value_locale, object_data_key, value) "
"WHERE value_locale IS NOT NULL;"_ns};
QM_TRY(ExecuteSimpleSQLSequence(aConnection, commands));
QM_TRY(MOZ_TO_RESULT(ExecuteSimpleSQLSequence(aConnection, commands)));
QM_TRY(CreateFileTables(aConnection));
QM_TRY(MOZ_TO_RESULT(CreateFileTables(aConnection)));
QM_TRY(aConnection.SetSchemaVersion(kSQLiteSchemaVersion));
QM_TRY(MOZ_TO_RESULT(aConnection.SetSchemaVersion(kSQLiteSchemaVersion)));
return NS_OK;
}

Просмотреть файл

@ -480,8 +480,8 @@ nsresult Key::DecodeJSValInternal(const EncodedDataType*& aPos,
uint32_t index = 0;
JS::Rooted<JS::Value> val(aCx);
while (aPos < aEnd && *aPos - aTypeOffset != eTerminator) {
QM_TRY(DecodeJSValInternal(aPos, aEnd, aCx, aTypeOffset, &val,
aRecursionDepth + 1));
QM_TRY(MOZ_TO_RESULT(DecodeJSValInternal(aPos, aEnd, aCx, aTypeOffset,
&val, aRecursionDepth + 1)));
aTypeOffset = 0;

Просмотреть файл

@ -251,7 +251,7 @@ nsresult GetJSValFromKeyPathString(
// TODO: It would be nicer to do the cleanup using a RAII class or something.
// This last QM_TRY could be removed then.
QM_TRY(rv);
QM_TRY(MOZ_TO_RESULT(rv));
return NS_OK;
}

Просмотреть файл

@ -2927,72 +2927,76 @@ Result<bool, nsresult> MaybeUpgradeSchema(mozIStorageConnection& aConnection,
while (schemaVersion != kSQLiteSchemaVersion) {
switch (schemaVersion) {
case 4:
QM_TRY(UpgradeSchemaFrom4To5(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom4To5(aConnection)));
break;
case 5:
QM_TRY(UpgradeSchemaFrom5To6(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom5To6(aConnection)));
break;
case 6:
QM_TRY(UpgradeSchemaFrom6To7(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom6To7(aConnection)));
break;
case 7:
QM_TRY(UpgradeSchemaFrom7To8(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom7To8(aConnection)));
break;
case 8:
QM_TRY(UpgradeSchemaFrom8To9_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom8To9_0(aConnection)));
vacuumNeeded = true;
break;
case MakeSchemaVersion(9, 0):
QM_TRY(UpgradeSchemaFrom9_0To10_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom9_0To10_0(aConnection)));
break;
case MakeSchemaVersion(10, 0):
QM_TRY(UpgradeSchemaFrom10_0To11_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom10_0To11_0(aConnection)));
break;
case MakeSchemaVersion(11, 0):
QM_TRY(UpgradeSchemaFrom11_0To12_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom11_0To12_0(aConnection)));
break;
case MakeSchemaVersion(12, 0):
QM_TRY(UpgradeSchemaFrom12_0To13_0(aConnection, &vacuumNeeded));
QM_TRY(MOZ_TO_RESULT(
UpgradeSchemaFrom12_0To13_0(aConnection, &vacuumNeeded)));
break;
case MakeSchemaVersion(13, 0):
QM_TRY(UpgradeSchemaFrom13_0To14_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom13_0To14_0(aConnection)));
break;
case MakeSchemaVersion(14, 0):
QM_TRY(UpgradeSchemaFrom14_0To15_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom14_0To15_0(aConnection)));
break;
case MakeSchemaVersion(15, 0):
QM_TRY(UpgradeSchemaFrom15_0To16_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom15_0To16_0(aConnection)));
break;
case MakeSchemaVersion(16, 0):
QM_TRY(UpgradeSchemaFrom16_0To17_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom16_0To17_0(aConnection)));
break;
case MakeSchemaVersion(17, 0):
QM_TRY(UpgradeSchemaFrom17_0To18_0(aConnection, aOrigin));
QM_TRY(
MOZ_TO_RESULT(UpgradeSchemaFrom17_0To18_0(aConnection, aOrigin)));
vacuumNeeded = true;
break;
case MakeSchemaVersion(18, 0):
QM_TRY(UpgradeSchemaFrom18_0To19_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom18_0To19_0(aConnection)));
break;
case MakeSchemaVersion(19, 0):
QM_TRY(UpgradeSchemaFrom19_0To20_0(&aFMDirectory, aConnection));
QM_TRY(MOZ_TO_RESULT(
UpgradeSchemaFrom19_0To20_0(&aFMDirectory, aConnection)));
break;
case MakeSchemaVersion(20, 0):
QM_TRY(UpgradeSchemaFrom20_0To21_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom20_0To21_0(aConnection)));
break;
case MakeSchemaVersion(21, 0):
QM_TRY(UpgradeSchemaFrom21_0To22_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom21_0To22_0(aConnection)));
break;
case MakeSchemaVersion(22, 0):
QM_TRY(UpgradeSchemaFrom22_0To23_0(aConnection, aOrigin));
QM_TRY(
MOZ_TO_RESULT(UpgradeSchemaFrom22_0To23_0(aConnection, aOrigin)));
break;
case MakeSchemaVersion(23, 0):
QM_TRY(UpgradeSchemaFrom23_0To24_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom23_0To24_0(aConnection)));
break;
case MakeSchemaVersion(24, 0):
QM_TRY(UpgradeSchemaFrom24_0To25_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom24_0To25_0(aConnection)));
break;
case MakeSchemaVersion(25, 0):
QM_TRY(UpgradeSchemaFrom25_0To26_0(aConnection));
QM_TRY(MOZ_TO_RESULT(UpgradeSchemaFrom25_0To26_0(aConnection)));
break;
default:
QM_FAIL(Err(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR), []() {