mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
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:
parent
09d9f7bb4a
commit
c10f1ac2e6
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user