Closed Bug 1002570 Opened 6 years ago Closed 5 years ago

Implement access to various ServiceWorkerContainer ServiceWorker instances

Categories

(Core :: DOM: Workers, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: nsm, Assigned: nsm)

References

Details

Attachments

(1 file, 1 obsolete file)

Based on the resolution of spec issue https://github.com/slightlyoff/ServiceWorker/issues/232

A placeholder bug to land Bug 930348 with FIXMEs.
While the DOM exposed API is unintuitive when new registrations are performed, the updated spec makes this much easier to understand. I'd like to land this before making the DOM facing spec changes from https://github.com/slightlyoff/ServiceWorker/issues/365 since the ServiceWorkerManager code remains mostly unchanged.
Attachment #8461164 - Flags: review?(ehsan)
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
MaybeStartControlling() should only control the document if the registration has a non-null active worker.
Attachment #8461180 - Flags: review?(ehsan)
Attachment #8461164 - Attachment is obsolete: true
Attachment #8461164 - Flags: review?(ehsan)
Comment on attachment 8461180 [details] [diff] [review]
Return valid ServiceWorker instances for .installing, .waiting, .active and .controller

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

r=me with the CC issue fixed.

::: dom/workers/ServiceWorkerContainer.cpp
@@ +24,5 @@
>  namespace dom {
>  namespace workers {
>  
>  NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorkerContainer)
>  NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)

Don't you need to hook up these new members to the CC?

::: dom/workers/ServiceWorkerManager.h
@@ +99,5 @@
> +enum WhichServiceWorker {
> +  INSTALLING_WORKER = 1,
> +  WAITING_WORKER    = 2,
> +  ACTIVE_WORKER     = 4,
> +};

It would be nice if you used a typed enum here with MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS.  Could be a follow-up.
Attachment #8461180 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/c8efe58e064c
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.