зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1659683 - QM: Record first initialization attempt directly in UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory; r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D87424
This commit is contained in:
Родитель
fceae5b85b
Коммит
a07b1845e7
|
@ -5386,6 +5386,7 @@ QuotaManager::UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory(
|
|||
AssertIsOnIOThread();
|
||||
MOZ_ASSERT(aIndexedDBDir);
|
||||
|
||||
auto rv = [this, &aIndexedDBDir]() -> nsresult {
|
||||
bool isDirectory;
|
||||
QM_TRY(aIndexedDBDir->IsDirectory(&isDirectory));
|
||||
|
||||
|
@ -5401,8 +5402,8 @@ QuotaManager::UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory(
|
|||
|
||||
nsCOMPtr<nsIFile> persistentStorageDir = persistentStorageDirOrErr.unwrap();
|
||||
|
||||
QM_TRY(
|
||||
persistentStorageDir->Append(nsLiteralString(PERSISTENT_DIRECTORY_NAME)));
|
||||
QM_TRY(persistentStorageDir->Append(
|
||||
nsLiteralString(PERSISTENT_DIRECTORY_NAME)));
|
||||
|
||||
bool exists;
|
||||
QM_TRY(persistentStorageDir->Exists(&exists));
|
||||
|
@ -5431,6 +5432,12 @@ QuotaManager::UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory(
|
|||
nsLiteralString(PERSISTENT_DIRECTORY_NAME)));
|
||||
|
||||
return NS_OK;
|
||||
}();
|
||||
|
||||
mInitializationInfo.RecordFirstInitializationAttempt(
|
||||
Initialization::UpgradeFromIndexedDBDirectory, rv);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -6377,15 +6384,8 @@ nsresult QuotaManager::EnsureStorageIsInitialized() {
|
|||
ToResultInvoke(indexedDBDir, &nsIFile::Exists));
|
||||
|
||||
if (indexedDBDirExists) {
|
||||
// TODO: Convert to QM_TRY once upgrade functions record first
|
||||
// initialization attempts directly.
|
||||
nsresult rv = UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory(
|
||||
indexedDBDir);
|
||||
mInitializationInfo.RecordFirstInitializationAttempt(
|
||||
Initialization::UpgradeFromIndexedDBDirectory, rv);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
QM_TRY(UpgradeFromIndexedDBDirectoryToPersistentStorageDirectory(
|
||||
indexedDBDir));
|
||||
}
|
||||
|
||||
QM_TRY_VAR(auto persistentStorageDir, QM_NewLocalFile(mStoragePath));
|
||||
|
|
Загрузка…
Ссылка в новой задаче