Forcibly clear worker ref counts on shutdown.
Original patch author: horo@ at
https://codereview.chromium.org/2248583003/
bug 608049 is a top crasher on stable channel. The cause is that render process
hosts are not reliably destructing on shutdown because shared workers keep them
alive.
Shared worker bookkeeping is expected to return the worker ref counts to zero
when documents close, but I suspect it often doesn't finish in time for
shutdown since it requires posting tasks between the IO thread and UI thread.
https://crrev.com/798a8b94726d3c439e6302998f31bc487f521ec8 tried to solve the
bug by removing waiting for an IPC from the renderer process, but the thread
hopping means shutdown is still racy.
This patch forcibly sets the ref counts to 0 on the UI thread when the browser
context is shutting down, similar to what we do for service workers.
BUG=
636377,
608049
Committed:
https://crrev.com/04a6912a1a2b77faf61e4b2514b9ecff74ee1f21
Cr-Commit-Position: refs/heads/master@{#420728}