[ServiceWorker] Accessing service worker state from worker (#674)

Step 1 from the clients.claim() specification requires checking the associated service worker's state from the worker thread. This would require some sort of synchronization mechanism with the other parts of the spec that access/change a service worker's state.

I think the spec should give some clear direction on what the intended behaviour is. More specifically, should a claim() call from oninstall always fail?
If so, what should be the result of the claim promise in the following case:
oninstall = function() {
  var p = new Promise(function(res, rej) {
      onmessage = res;
  });
  p.then(self.claim);
}

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/674

Received on Monday, 6 April 2015 23:38:41 UTC