зеркало из https://github.com/mozilla/gecko-dev.git
Don't crash when setting a previously deleted cookie permission.
bug 300301, r=dwitte, sr=darin, a=mconnor.
This commit is contained in:
Родитель
e615e21d5e
Коммит
660a01e085
|
@ -288,6 +288,13 @@ nsPermissionManager::AddInternal(const nsAFlatCString &aHost,
|
||||||
PRUint32 oldPermission = entry->GetPermission(aTypeIndex);
|
PRUint32 oldPermission = entry->GetPermission(aTypeIndex);
|
||||||
entry->SetPermission(aTypeIndex, aPermission);
|
entry->SetPermission(aTypeIndex, aPermission);
|
||||||
|
|
||||||
|
// If no more types are present, remove the entry
|
||||||
|
// Can happen if this add() is resetting the permission to default.
|
||||||
|
if (entry->PermissionsAreEmpty()) {
|
||||||
|
mHostTable.RawRemoveEntry(entry);
|
||||||
|
--mHostCount;
|
||||||
|
}
|
||||||
|
|
||||||
// check whether we are deleting, adding, or changing a permission,
|
// check whether we are deleting, adding, or changing a permission,
|
||||||
// so we can notify observers. this would be neater to do in Add(),
|
// so we can notify observers. this would be neater to do in Add(),
|
||||||
// but we need to do it here because we only know what type of notification
|
// but we need to do it here because we only know what type of notification
|
||||||
|
|
Загрузка…
Ссылка в новой задаче