ServiceWorker WebProcess sometimes crashes in JSVMClientData::~JSVMClientData()
https://bugs.webkit.org/show_bug.cgi?id=180173
Reviewed by Alex Christensen.
The leak was caused by EventListeners remaining when destroying the VM, because
JSEventListener refs the DOMWrapperWorld. To address the issue, we now call
removeAllEventListeners() in the stop() method of ServiceWorkerContainer,
ServiceWorkerRegistration and ServiceWorker. Those event listeners are no
longer needed after ActiveDOMObject::stop() is called since the script
execution context is about to be destroyed.
This is the same pattern used in IDBDatabase::stop(), IDBRequest::stop().
No new tests, already covered by existing test.
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::stop):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::stop):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::stop):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225316
268f45cc-cd09-0410-ab3c-
d52691b4dbfc