Background at Issue 676526 .
When a worker stops we want to send WorkerStopped then ProviderDestroyed to the browser. WorkerStopped enables the browser to run the start/stop callbacks on ServiceWorkerVersion before ProviderDestroyed can teardown the ServiceWorkerProviderHost/ServiceWorkerVersion objects.
Or we could teach the browser to handle the reverse ordering somehow, but seems cleaner to just guarantee an ordering or possibly collapse the messages into one.
However I'm not sure a real bug is here since callers don't seem to care about the StopWorker callback. One problem might be that start callbacks are not invoked (in case a StopWorker interrupts a StartWorker). Also, it looks like most of the time the ordering is correct anyway.
Comment 1 by shimazu@chromium.org
, Jan 13 2017