Backed out changeset 57167b45c9d3 (bug 1183141) for wpt failures.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-07-13 21:07:29 -04:00
Родитель 66a68d91af
Коммит 0011e3d331
1 изменённых файлов: 14 добавлений и 6 удалений

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

@ -3996,7 +3996,19 @@ FireControllerChangeOnMatchingDocument(nsISupports* aKey,
return PL_DHASH_NEXT;
}
} // anonymous namespace
static PLDHashOperator
ClaimMatchingClients(nsISupportsHashKey* aKey, void* aData)
{
nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
ServiceWorkerRegistrationInfo* workerRegistration =
static_cast<ServiceWorkerRegistrationInfo*>(aData);
nsCOMPtr<nsIDocument> document = do_QueryInterface(aKey->GetKey());
swm->MaybeClaimClient(document, workerRegistration);
return PL_DHASH_NEXT;
}
} // namespace
void
ServiceWorkerManager::GetAllClients(nsIPrincipal* aPrincipal,
@ -4064,11 +4076,7 @@ ServiceWorkerManager::ClaimClients(nsIPrincipal* aPrincipal,
return NS_ERROR_DOM_INVALID_STATE_ERR;
}
nsRefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
for (auto iter = mAllDocuments.Iter(); !iter.Done(); iter.Next()) {
nsCOMPtr<nsIDocument> document = do_QueryInterface(iter.Get()->GetKey());
swm->MaybeClaimClient(document, registration);
}
mAllDocuments.EnumerateEntries(ClaimMatchingClients, registration);
return NS_OK;
}