Bug 1899292 - Call EnsureReadCompleted before computing permission type index. r=permissions-reviewers,timhuang

Differential Revision: https://phabricator.services.mozilla.com/D211854
This commit is contained in:
Paul Zuehlcke 2024-05-28 15:26:04 +00:00
Родитель 83c1f27889
Коммит c455cf46f1
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -2195,6 +2195,10 @@ NS_IMETHODIMP
PermissionManager::RemoveByType(const nsACString& aType) {
ENSURE_NOT_CHILD_PROCESS;
// Need to make sure read is done before we get the type index. Type indexes
// are populated from DB.
EnsureReadCompleted();
int32_t typeIndex = GetTypeIndex(aType, false);
// If type == -1, the type isn't known,
// so just return NS_OK
@ -2213,6 +2217,10 @@ PermissionManager::RemoveByTypeSince(const nsACString& aType,
int64_t aModificationTime) {
ENSURE_NOT_CHILD_PROCESS;
// Need to make sure read is done before we get the type index. Type indexes
// are populated from DB.
EnsureReadCompleted();
int32_t typeIndex = GetTypeIndex(aType, false);
// If type == -1, the type isn't known,
// so just return NS_OK