зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1425975 P5 Make ServiceWorkerManager::RemoveRegistration assert there is no controlled document. r=asuth
This commit is contained in:
Родитель
ef72634aa7
Коммит
12e02a611a
|
@ -2309,17 +2309,18 @@ ServiceWorkerManager::RemoveScopeAndRegistration(ServiceWorkerRegistrationInfo*
|
|||
entry.Remove();
|
||||
}
|
||||
|
||||
// The registration should generally only be removed if there are no controlled
|
||||
// documents, but mControlledDocuments can contain references to potentially
|
||||
// controlled docs. This happens when the service worker is not active yet.
|
||||
// We must purge these references since we are evicting the registration.
|
||||
// Verify there are no controlled documents for the purged registration.
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
for (auto iter = swm->mControlledDocuments.Iter(); !iter.Done(); iter.Next()) {
|
||||
ServiceWorkerRegistrationInfo* reg = iter.UserData();
|
||||
MOZ_ASSERT(reg);
|
||||
if (reg->mScope.Equals(aRegistration->mScope)) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(false,
|
||||
"controlled document when removing registration");
|
||||
iter.Remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
RefPtr<ServiceWorkerRegistrationInfo> info;
|
||||
data->mInfos.Remove(aRegistration->mScope, getter_AddRefs(info));
|
||||
|
|
Загрузка…
Ссылка в новой задаче