Bug 1278831 - DOMEventTargetHelper must release itself when disconnected from the owner and when kept alive by some event listener, r=smaug

This commit is contained in:
Andrea Marchesini 2018-08-01 00:19:15 +02:00
Родитель 49cbe794ae
Коммит 059ca97fce
1 изменённых файлов: 13 добавлений и 11 удалений

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

@ -295,20 +295,22 @@ DOMEventTargetHelper::MaybeUpdateKeepAlive()
{
bool shouldBeKeptAlive = false;
if (!mKeepingAliveTypes.mAtoms.IsEmpty()) {
for (uint32_t i = 0; i < mKeepingAliveTypes.mAtoms.Length(); ++i) {
if (HasListenersFor(mKeepingAliveTypes.mAtoms[i])) {
shouldBeKeptAlive = true;
break;
if (NS_SUCCEEDED(CheckInnerWindowCorrectness())) {
if (!mKeepingAliveTypes.mAtoms.IsEmpty()) {
for (uint32_t i = 0; i < mKeepingAliveTypes.mAtoms.Length(); ++i) {
if (HasListenersFor(mKeepingAliveTypes.mAtoms[i])) {
shouldBeKeptAlive = true;
break;
}
}
}
}
if (!shouldBeKeptAlive && !mKeepingAliveTypes.mStrings.IsEmpty()) {
for (uint32_t i = 0; i < mKeepingAliveTypes.mStrings.Length(); ++i) {
if (HasListenersFor(mKeepingAliveTypes.mStrings[i])) {
shouldBeKeptAlive = true;
break;
if (!shouldBeKeptAlive && !mKeepingAliveTypes.mStrings.IsEmpty()) {
for (uint32_t i = 0; i < mKeepingAliveTypes.mStrings.Length(); ++i) {
if (HasListenersFor(mKeepingAliveTypes.mStrings[i])) {
shouldBeKeptAlive = true;
break;
}
}
}
}