[slightlyoff/ServiceWorker] spec should queue tasks to expose attribute changes on ServiceWorker and ServiceWorkerRegistration (#860)

The spec has a couple DOM objects that are exposed to both main thread window and workers such that they represent the same underlying object.  ServiceWorker and ServiceWorkerRegistration are the main ones I'm aware of right now.

The attribute getters for both of these objects are written like this:

```
installing attribute must return the result of running these steps or their equivalent:
    1) Let installingWorker be the ServiceWorker object that represents the service worker
        registration’s installing worker.
    2) Return installingWorker. 
```

Essentially as a synchronous getter on the underlying shared data.  There is no explicit concurrency protection here.

The most likely way for implementations to actual write the code, however, is to queue tasks to update the attributes on the exposed DOM objects.  We should update the spec to be explicit about this.

This is important because whether we queue a task or not can have observable effects based on when statechange and updatefound events fire.  Those events are executed through queued tasks.  Using queued tasks for the attribute changes would ensure a consistent view of shared data by content script.



---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/860

Received on Tuesday, 29 March 2016 18:07:13 UTC