Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate 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 w3c/ServiceWorker#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 w3c/ServiceWorker#1041 BUG=485900,678899 Review-Url: https://codereview.chromium.org/2602853002 Cr-Original-Commit-Position: refs/heads/master@{#442590} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 815dc48c9d00b0142a2421de8f10b7cb9c5b34ab
- Loading branch information