DescriptionEliminate network fallback from ServiceWorkerContextRequestHandler.
ServiceWorkerContextRequestHandler should emit a network error instead
of falling back to network when it cannot handle a request. Otherwise, a
service worker can be spawned that did not load via our custom
ServiceWorkerWriteToCacheJob/ServiceWorkerReadFromCacheJob jobs,
resulting in a running worker whose ServiceWorkerVersion has not
been properly initialized. I suspect this can cause the bug 485900.
This patch:
- Changes network fallback for failure cases to an ERR_FAILED network
error.
- As an exception, an installed worker loading an unstored script still
results in network fallback. This should be deprecated and removed
eventually, see https://github.com/w3c/ServiceWorker/issues/1021.
- Changes the behavior for a new worker loading an already stored script
(i.e., calling importScripts() for the same script multiple times).
Before this patch, we would fallback to network for this script. Now,
we read the stored script. This is not yet codified in the spec but is
expected to have almost no real-world impact and has support on
https://github.com/w3c/ServiceWorker/issues/1041
BUG=485900, 678899
Review-Url: https://codereview.chromium.org/2602853002
Cr-Commit-Position: refs/heads/master@{#442590}
Committed: https://chromium.googlesource.com/chromium/src/+/815dc48c9d00b0142a2421de8f10b7cb9c5b34ab
Patch Set 1 #Patch Set 2 : rm notreached #Patch Set 3 : add rtsets #Patch Set 4 : more test #Patch Set 5 : rm redundant tests #Patch Set 6 : ok #
Total comments: 25
Patch Set 7 : rebase #Patch Set 8 : review comments #Patch Set 9 : typos #
Total comments: 2
Patch Set 10 : rm class #Messages
Total messages: 38 (28 generated)
|