Skip to content

Commit

Permalink
Bug 1144876 - Stop spamming stderr with a warning every time that we …
Browse files Browse the repository at this point in the history
…encounter a document that is not controlled by a service worker; r=nsm
  • Loading branch information
ehsan authored and tworaz committed Sep 14, 2015
1 parent c555278 commit 55f2900
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dom/workers/ServiceWorkerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2366,7 +2366,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;
}
Expand All @@ -2377,7 +2380,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.
Expand Down

0 comments on commit 55f2900

Please sign in to comment.