Service Worker: Add metrics and timeout for starting a Service Worker.
commit292e84ac2c4a0b0074d5ece1eabfebec7fed1ebb
authorfalken <falken@chromium.org>
Thu, 5 Mar 2015 16:54:25 +0000 (5 08:54 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Mar 2015 16:55:14 +0000 (5 16:55 +0000)
tree56a1d61540fd43c00a7d20f27e36c7eafe130c96
parent60e6e6fbcc7f8d140c00ebaa8f7a50a154d12410
Service Worker: Add metrics and timeout for starting a Service Worker.

There are some reports of SW getting wedged in the "STARTING" state.
This CL adds metrics to understand the issue and a timeout for
aborting start so that retrying might succeed.

The timeout is 5 minutes (same as the limit for events proposed in
crbug.com/372436). We already have a timeout for 30 seconds of script
evaluation, so this new timeout covers possible failures like getting
stuck trying to allocate a process or waiting for an ack from the
renderer.

5 minutes may be too harsh for users on slow connections, so future
work on some sort of exponential backoff or varying the limit for new
vs installed workers may be possible. An existing issue is the 30
second timeout for script evaluation includes importScripts(),
which could potentially take a long time downloading scripts.

BUG=448003

Review URL: https://codereview.chromium.org/962543005

Cr-Commit-Position: refs/heads/master@{#319262}
14 files changed:
content/browser/notifications/notification_event_dispatcher_impl.cc
content/browser/push_messaging/push_messaging_message_filter.cc
content/browser/push_messaging/push_messaging_router.cc
content/browser/service_worker/embedded_worker_instance.cc
content/browser/service_worker/embedded_worker_instance.h
content/browser/service_worker/service_worker_register_job.cc
content/browser/service_worker/service_worker_registration_status.cc
content/browser/service_worker/service_worker_version.cc
content/browser/service_worker/service_worker_version.h
content/browser/service_worker/service_worker_version_unittest.cc
content/common/service_worker/service_worker_status_code.cc
content/common/service_worker/service_worker_status_code.h
content/renderer/service_worker/embedded_worker_context_client.cc
tools/metrics/histograms/histograms.xml