зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1186810 (part 3) - Replace nsBaseHashtable::EnumerateRead() calls in dom/workers/ with iterators. r=nsm.
--HG-- extra : rebase_source : b30e110d8fe10dcbfef51278c1d2178acd88d004
This commit is contained in:
Родитель
ef9fab3e31
Коммит
5b93c35c8a
|
@ -3967,17 +3967,6 @@ ServiceWorkerManager::PropagateRemoveAll()
|
||||||
mActor->SendPropagateRemoveAll();
|
mActor->SendPropagateRemoveAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
static PLDHashOperator
|
|
||||||
UpdateEachRegistration(const nsACString& aKey,
|
|
||||||
ServiceWorkerRegistrationInfo* aInfo,
|
|
||||||
void* aUserArg) {
|
|
||||||
auto This = static_cast<ServiceWorkerManager*>(aUserArg);
|
|
||||||
MOZ_ASSERT(!aInfo->mScope.IsEmpty());
|
|
||||||
|
|
||||||
This->SoftUpdate(aInfo->mPrincipal, aInfo->mScope);
|
|
||||||
return PL_DHASH_NEXT;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ServiceWorkerManager::RemoveAllRegistrations(OriginAttributes* aParams)
|
ServiceWorkerManager::RemoveAllRegistrations(OriginAttributes* aParams)
|
||||||
{
|
{
|
||||||
|
@ -3989,20 +3978,19 @@ ServiceWorkerManager::RemoveAllRegistrations(OriginAttributes* aParams)
|
||||||
aParams);
|
aParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PLDHashOperator
|
|
||||||
UpdateEachRegistrationPerPrincipal(const nsACString& aKey,
|
|
||||||
ServiceWorkerManager::RegistrationDataPerPrincipal* aData,
|
|
||||||
void* aUserArg) {
|
|
||||||
aData->mInfos.EnumerateRead(UpdateEachRegistration, aUserArg);
|
|
||||||
return PL_DHASH_NEXT;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
ServiceWorkerManager::UpdateAllRegistrations()
|
ServiceWorkerManager::UpdateAllRegistrations()
|
||||||
{
|
{
|
||||||
AssertIsOnMainThread();
|
AssertIsOnMainThread();
|
||||||
|
|
||||||
mRegistrationInfos.EnumerateRead(UpdateEachRegistrationPerPrincipal, this);
|
for (auto it1 = mRegistrationInfos.Iter(); !it1.Done(); it1.Next()) {
|
||||||
|
for (auto it2 = it1.UserData()->mInfos.Iter(); !it2.Done(); it2.Next()) {
|
||||||
|
ServiceWorkerRegistrationInfo* info = it2.UserData();
|
||||||
|
MOZ_ASSERT(!info->mScope.IsEmpty());
|
||||||
|
|
||||||
|
SoftUpdate(info->mPrincipal, info->mScope);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче