Skip to content

Commit

Permalink
Improve navigate for service worker hooks
Browse files Browse the repository at this point in the history
Before this patch, we didn't have a concept that holds reserved
client's information referenced from a service worker during a
navigation (more precisely before the actual global object and its
relevant environment settings object for the resulting resource is
created).

This patch defines an "environment" concept (a supertype object of an
environment settings object) that has its id, creation URL and target
browsing context such that service workers' FetchEvent hanlder can
reference this client information before the corresponding environmet
setings object is actually created.

The changes include:
 - Create an environment (a reserved client) during a navigation
 - Set request's reserved client id such that fetch (and Handle Fetch)
 can use it
 - Set request's target client id such that fetch (and Handle Fetch)
 can use it
 - Add Window object's active worker internal slot
 - Add WorkerGlobalObject's active worker internal slot
 - Add "match service worker registration" logic to attach controller

Related issue: w3c/ServiceWorker#870
Call flow: w3c/ServiceWorker#870 (comment)
Expected behavior: w3c/ServiceWorker#870 (comment)
Related changes:
 - SW (WIP): w3c/ServiceWorker@df39d89
 - Fetch: whatwg/fetch#383
  • Loading branch information
jungkees committed Sep 28, 2016
1 parent 2aa0000 commit adda326
Showing 1 changed file with 225 additions and 243 deletions.
Loading

0 comments on commit adda326

Please sign in to comment.