Because extension service workers can perform extension API call early enough before the worker reaches "activated" stage (typically I see that ServiceWorkerVersion::running_status() is EmbeddedWorkerStatus::STARTING), calls to ServiceWorkerVersion::Start/FinishExternalRequest before that will result in incorrect bookkeeping of external requests. This leads to bad_message from ExtensionServiceWorkerMessageFilter on decrement.
We should, instead, queue up external requests in ServiceWorkerVersion and let them through once the worker reaches running stage.
Comment 1 by bugdroid1@chromium.org
, Jun 8 2018