зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
bcf3efd1b8
Коммит
c1888990fc
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче