Bug 1144876 - Stop spamming stderr with a warning every time that we encounter a document that is not controlled by a service worker; r=nsm

This commit is contained in:
Ehsan Akhgari 2015-03-18 14:16:00 +01:00
parent 09d9f7bb4a
commit c10f1ac2e6

View File

@ -2361,7 +2361,10 @@ ServiceWorkerManager::IsControlled(nsIDocument* aDoc, bool* aIsControlled)
MOZ_ASSERT(aIsControlled);
nsRefPtr<ServiceWorkerRegistrationInfo> registration;
nsresult rv = GetDocumentRegistration(aDoc, getter_AddRefs(registration));
NS_ENSURE_SUCCESS(rv, rv);
if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_NOT_AVAILABLE)) {
// It's OK to ignore the case where we don't have a registration.
return rv;
}
*aIsControlled = !!registration;
return NS_OK;
}
@ -2372,7 +2375,7 @@ ServiceWorkerManager::GetDocumentRegistration(nsIDocument* aDoc,
{
nsRefPtr<ServiceWorkerRegistrationInfo> registration;
if (!mControlledDocuments.Get(aDoc, getter_AddRefs(registration))) {
return NS_ERROR_FAILURE;
return NS_ERROR_NOT_AVAILABLE;
}
// If the document is controlled, the current worker MUST be non-null.