mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 15:17:29 +09:00
[DOM] Improve MessagePort state machine.
This commit is contained in:
parent
d55111c4fd
commit
114daae894
1 changed files with 6 additions and 0 deletions
|
|
@ -296,6 +296,11 @@ MessagePort::MessagePort(nsIGlobalObject* aGlobal)
|
||||||
MessagePort::~MessagePort()
|
MessagePort::~MessagePort()
|
||||||
{
|
{
|
||||||
CloseForced();
|
CloseForced();
|
||||||
|
MOZ_ASSERT(!mActor);
|
||||||
|
if (mActor) {
|
||||||
|
mActor->SetPort(nullptr);
|
||||||
|
mActor = nullptr;
|
||||||
|
}
|
||||||
MOZ_ASSERT(!mWorkerHolder);
|
MOZ_ASSERT(!mWorkerHolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -370,6 +375,7 @@ MessagePort::Initialize(const nsID& aUUID,
|
||||||
|
|
||||||
nsAutoPtr<WorkerHolder> workerHolder(new MessagePortWorkerHolder(this));
|
nsAutoPtr<WorkerHolder> workerHolder(new MessagePortWorkerHolder(this));
|
||||||
if (NS_WARN_IF(!workerHolder->HoldWorker(workerPrivate, Closing))) {
|
if (NS_WARN_IF(!workerHolder->HoldWorker(workerPrivate, Closing))) {
|
||||||
|
CloseForced();
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue