Fix crash during EmbeddedWorkerInstance startup sequence failures
commit37b83877e63f62f8aebb337494f1116539182bdf
authorfalken <falken@chromium.org>
Thu, 17 Sep 2015 07:14:03 +0000 (17 00:14 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 17 Sep 2015 07:15:14 +0000 (17 07:15 +0000)
tree9dbc2341852a52b2f80776e1363116a3c1302335
parent3d4471a97f9bf78a30474bfa87e0119ca28c3372
Fix crash during EmbeddedWorkerInstance startup sequence failures

Once EWInstance startup calls the callback, it's possible that the
underlying ServiceWorkerVersion is destroyed, hence destroying
|this|. We must guard against that.

Also some failure points in the startup sequence weren't calling
OnStopped() as expected.

BUG=529520, 531345

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

Cr-Commit-Position: refs/heads/master@{#349368}
content/browser/service_worker/embedded_worker_instance.cc
content/browser/service_worker/embedded_worker_instance.h
content/browser/service_worker/embedded_worker_instance_unittest.cc