[ServiceWorker] Return abort for browser shutdown during registration.
When a worker is registered while the browser context is shutting down we return kErrorStartWorkerFailed. This appears to be a mistake since worker unregistration and start worker requests will kErrorAbort in this same situation instead. Worker registration requests will eventually start the worker, so kErrorStartWorkerFailed is eventually expected if the worker does fail to start during registration, but not immediately after a worker registration request is sent. Bug: 346732739 Change-Id: I4f831bf7a561b79364d6903e9c51e8dc86a380c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5833537 Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Commit-Queue: Justin Lulejian <jlulejian@chromium.org> Cr-Commit-Position: refs/heads/main@{#1352301}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
aa5b17c44c
commit
29cc3fcaa5
@ -582,10 +582,8 @@ void ServiceWorkerContextWrapper::RegisterServiceWorker(
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
if (!context_core_) {
|
||||
GetUIThreadTaskRunner({})->PostTask(
|
||||
FROM_HERE,
|
||||
base::BindOnce(
|
||||
std::move(callback),
|
||||
blink::ServiceWorkerStatusCode::kErrorStartWorkerFailed));
|
||||
FROM_HERE, base::BindOnce(std::move(callback),
|
||||
blink::ServiceWorkerStatusCode::kErrorAbort));
|
||||
return;
|
||||
}
|
||||
blink::mojom::ServiceWorkerRegistrationOptions options_to_pass(
|
||||
|
Reference in New Issue
Block a user