Push: Fix crash when dispatching push to a registration with no active worker
commit4a917d9d08ad3ee2cbb449b591640351ce76605b
authorfalken <falken@chromium.org>
Fri, 8 May 2015 09:52:28 +0000 (8 02:52 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 8 May 2015 09:53:01 +0000 (8 09:53 +0000)
tree5e9aeffe6d7b99e2f0bf9dad3fd383ecef664c6c
parent5b27284e3d228a905ff130869bf1ff2573730ce0
Push: Fix crash when dispatching push to a registration with no active worker

A registration could have no active worker in some cases:
- The browser shut down while there was a waiting worker. When the browser
starts up again, there will be no active worker until the waiting worker
is promoted (see
ServiceWorkerControlleeRequestHandler::DidLookupRegistrationForMainResource)
- The active worker was evicted, because it unexpectedly couldn't be read
from the disk cache: crbug.com/448003
- The subscription occurred while the registration had an active worker in
the activating state, but then activation failed and the worker was booted
(however this behavior will soon change: crbug.com/480050)

BUG=483335

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

Cr-Commit-Position: refs/heads/master@{#328940}
content/browser/push_messaging/push_messaging_router.cc