зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1776962 - Close SharedWorker on DETH disconnect. r=dom-worker-reviewers,smaug
SharedWorker can be a better lifecycle participant by closing itself promptly when its global disconnects its DETHs. This avoids the need to wait for CC. Differential Revision: https://phabricator.services.mozilla.com/D191821
This commit is contained in:
Родитель
90898c25ea
Коммит
572daab0e8
|
@ -427,6 +427,11 @@ void SharedWorker::GetEventTargetParent(EventChainPreVisitor& aVisitor) {
|
|||
DOMEventTargetHelper::GetEventTargetParent(aVisitor);
|
||||
}
|
||||
|
||||
void SharedWorker::DisconnectFromOwner() {
|
||||
Close();
|
||||
DOMEventTargetHelper::DisconnectFromOwner();
|
||||
}
|
||||
|
||||
void SharedWorker::ErrorPropagation(nsresult aError) {
|
||||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(mActor);
|
||||
|
|
|
@ -62,6 +62,8 @@ class SharedWorker final : public DOMEventTargetHelper {
|
|||
|
||||
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
||||
|
||||
void DisconnectFromOwner() override;
|
||||
|
||||
void ErrorPropagation(nsresult aError);
|
||||
|
||||
// Methods called from the window.
|
||||
|
|
Загрузка…
Ссылка в новой задаче