Bug 1232931 Return null instead of throwing if swm.getWorkerByID() cannot find the worker. r=ochameau IGNORE IDL for comment only change

This commit is contained in:
Ben Kelly 2016-01-15 09:37:34 -08:00
Родитель bcf3efd1b8
Коммит c1888990fc
2 изменённых файлов: 3 добавлений и 4 удалений

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

@ -57,7 +57,8 @@ interface nsIServiceWorkerRegistrationInfo : nsISupports
// Allows to get the related nsIServiceWorkerInfo for a given
// nsIWorkerDebugger. Over time we shouldn't need this anymore,
// and instead always control then nsIWorkerDebugger from
// nsIServiceWorkerInfo and not the other way around.
// nsIServiceWorkerInfo and not the other way around. Returns
// null if the service worker is no longer registered.
nsIServiceWorkerInfo getWorkerByID(in unsigned long long aID);
void addListener(in nsIServiceWorkerRegistrationInfoListener listener);

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

@ -508,9 +508,7 @@ ServiceWorkerRegistrationInfo::GetWorkerByID(uint64_t aID, nsIServiceWorkerInfo
MOZ_ASSERT(aResult);
RefPtr<ServiceWorkerInfo> info = GetServiceWorkerInfoById(aID);
if (NS_WARN_IF(!info)) {
return NS_ERROR_FAILURE;
}
// It is ok to return null for a missing service worker info.
info.forget(aResult);
return NS_OK;
}