Closed Bug 1216566 Opened 4 years ago Closed 4 years ago

Fix a bug in nsIServiceWorkerManager.getAllRegistrations


(Core :: DOM: Service Workers, defect)

Not set



Tracking Status
firefox45 --- fixed


(Reporter: ejpbruel, Assigned: ejpbruel)




(1 file, 1 obsolete file)

Currently, nsIServiceWorkerManager.getRegistrations returns an array of nsIServiceWorkerInfos. This doesn't really make sense, because nsIServiceWorkerInfo represents a service worker, not a service worker registration, and these two concepts are not interchangeable.

Instead, nsIServiceWorkerManager.getRegistrations should return an array of nsIServiceWorkerRegistrationInfos. This will also eliminate the need to use a ServiceWorkerDataInfo to adapt a ServiceWorkerRegistrationInfo to implement the nsIServiceWorkerInfo interface.
Attachment #8676331 - Flags: review?(catalin.badea392)
Comment on attachment 8676331 [details] [diff] [review]
Fix a bug in nsIServiceWorkerManager.getRegistrations

Review of attachment 8676331 [details] [diff] [review]:

I don't think we want to drop about:serviceworkers just yet and removing those properties from nsIServiceWorkerInfo will break it.

::: dom/interfaces/base/nsIServiceWorkerManager.idl
@@ -30,5 @@
> -  readonly attribute DOMString scriptSpec;
> -  readonly attribute DOMString currentWorkerURL;
> -
> -  readonly attribute DOMString activeCacheName;
> -  readonly attribute DOMString waitingCacheName;

Removing these properties will break about:serviceworkers. 

They are still used here:

::: toolkit/content/aboutServiceWorkers.js
@@ +61,3 @@
>        continue;
>      }
> +/

Please remove this line.
Attachment #8676331 - Flags: review?(catalin.badea392) → review-
Blocks: 1218363
Attached patch patchSplinter Review
New patch with comments addressed.
Attachment #8676331 - Attachment is obsolete: true
Attachment #8678829 - Flags: review?(catalin.badea392)
Summary: Fix a bug in nsIServiceWorkerManager.getRegistrations → Fix a bug in nsIServiceWorkerManager.getAllRegistrations
Attachment #8678829 - Attachment is patch: true
Attachment #8678829 - Attachment mime type: text/x-patch → text/plain
Attachment #8678829 - Flags: review?(catalin.badea392) → review+
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
removing the b2g 2.5 flag since this commit has been reverted due to an incorrect merge, sorry for the confusion
You need to log in before you can comment on or make changes to this bug.