Bug 1179489 - Don't count service workers towards an origin's max worker quota; r=nsm

This is a follow-up to bug 1178339.
This commit is contained in:
Ehsan Akhgari 2015-07-01 17:32:52 -04:00
parent 58e0eabbd0
commit d0d2389e74
2 changed files with 14 additions and 2 deletions

View File

@ -1668,7 +1668,7 @@ RuntimeService::UnregisterWorker(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
}
}
if (!domainInfo->ActiveWorkerCount()) {
if (domainInfo->HasNoWorkers()) {
MOZ_ASSERT(domainInfo->mQueuedWorkers.IsEmpty());
mDomainMap.Remove(domain);
}

View File

@ -56,9 +56,21 @@ class RuntimeService final : public nsIObserver
ActiveWorkerCount() const
{
return mActiveWorkers.Length() +
mActiveServiceWorkers.Length() +
mChildWorkerCount;
}
uint32_t
ActiveServiceWorkerCount() const
{
return mActiveServiceWorkers.Length();
}
bool
HasNoWorkers() const
{
return ActiveWorkerCount() == 0 &&
ActiveServiceWorkerCount() == 0;
}
};
struct IdleThreadInfo;