Closed Bug 1218363 Opened 9 years ago Closed 9 years ago

nsIServiceWorkerManager should notify its listeners when a service worker is (un)registered.

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: ejpbruel, Assigned: ejpbruel)

References

Details

Attachments

(1 file, 1 obsolete file)

We'd like to use ServiceWorkerManager to maintain a list of service worker registrations in the debugger server. However, unlike about:serviceworkers, which only refreshes the list when the user reloads the page, the debugger server is expected to notify its clients when the list of registrations changes.

To implement this, ServiceWorkerManager needs to emit an event when a service worker is (un)registered.
Blocks: 1218817
Summary: ServiceWorkerManager should emit an event when a service worker is (un)registered. → ServiceWorkerManager should emit an event when the list of registrations changes.
Summary: ServiceWorkerManager should emit an event when the list of registrations changes. → nsIServiceWorkerManager should emit an event when the list of registrations changes.
Summary: nsIServiceWorkerManager should emit an event when the list of registrations changes. → nsIServiceWorkerManager should notify its listeners when a service worker is (unregistered).
Fixed some minor bugs that I found in the patch, plus cleaned up the test to make it easier to read.
Attachment #8678831 - Attachment is obsolete: true
Attachment #8678831 - Flags: review?(catalin.badea392)
Attachment #8682415 - Flags: review?(catalin.badea392)
Catalin, could you take a look at this patch soon? It's been over a week since I put it up for review.
Flags: needinfo?(catalin.badea392)
Summary: nsIServiceWorkerManager should notify its listeners when a service worker is (unregistered). → nsIServiceWorkerManager should notify its listeners when a service worker is (un)registered.
Attachment #8682415 - Attachment description: nsIServiceWorkerManager should notify its listeners when a service worker is (unregistered). → nsIServiceWorkerManager should notify its listeners when a service worker is (un)registered.
Comment on attachment 8682415 [details] [diff] [review]
nsIServiceWorkerManager should notify its listeners when a service worker is (un)registered.

Review of attachment 8682415 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/workers/test/serviceworkers/test_serviceworkermanager.xul
@@ +19,5 @@
> +              getService(Ci.nsIServiceWorkerManager);
> +
> +    function waitForIframeLoad(iframe) {
> +      return new Promise(function (resolve) {
> +        iframe.onload = function () {

nit: iframe.onload = resolve;
Attachment #8682415 - Flags: review?(catalin.badea392) → review+
clearing ni, sorry for the delay.
Flags: needinfo?(catalin.badea392)
backed out for m-oth bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=16785971&repo=mozilla-inbound
Flags: needinfo?(ejpbruel)
(In reply to Carsten Book [:Tomcat] from comment #8)
> backed out for m-oth bustage like
> https://treeherder.mozilla.org/logviewer.html#?job_id=16785971&repo=mozilla-
> inbound

Ugh. I made a last minute change to one of the helper files before landing (I really shouldn't do that), and ended up removing it from the chrome.ini in the process. That's why the try run looked fine, but m-i did not.

All the other tests looked fine, so I think we can land this again with the chrome.ini issue resolved.
Flags: needinfo?(ejpbruel)
Blocks: 1221892
https://hg.mozilla.org/mozilla-central/rev/317f1490ee1f
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: