[ESW] Fix IPC handling in WorkerThreadDispatcher after worker shutdown.
IPCs to WorkerThreadDispatcher arrive initially on main thread via WorkerThreadDispatcher::OnControlMessageReceived() [1]. This IPC is forwarded to worker thread, via WorkerThreadDispatcher::OnMessageReceivedOnWorkerThread() [2]. If the worker destruction (Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread) happens on worker thread between [1] and [2], IPC forwarding succeeds (b/c the worker is alive at [1]), but IPC handling doesn't (as worker data is already cleared while we run [2]). Fix this by checking worker data's existence while handling the IPC on worker thread and bailing out. Bug: 1008143 Test: Locally running ServiceWorkerTest.Update*Extension thousand times. Change-Id: Id5dd1b4c3d24995228aeb0f1fdd72edc1b77f747 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825169Reviewed-by:David Bertoni <dbertoni@chromium.org> Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org> Cr-Commit-Position: refs/heads/master@{#700087}
Showing
Please register or sign in to comment