mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
a907bc3c17
10 changed files with 85 additions and 36 deletions
|
|
@ -2548,16 +2548,22 @@ WebSocket::Close(const Optional<uint16_t>& aCode,
|
|||
return;
|
||||
}
|
||||
|
||||
// If the webSocket is not closed we MUST have a mImpl.
|
||||
MOZ_ASSERT(mImpl);
|
||||
// If we don't have mImpl, we are in a shutting down worker where we are still
|
||||
// in CONNECTING state, but already disconnected internally.
|
||||
if (!mImpl) {
|
||||
MOZ_ASSERT(readyState == CONNECTING);
|
||||
SetReadyState(CLOSING);
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<WebSocketImpl> impl = mImpl;
|
||||
if (readyState == CONNECTING) {
|
||||
mImpl->FailConnection(closeCode, closeReason);
|
||||
impl->FailConnection(closeCode, closeReason);
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(readyState == OPEN);
|
||||
mImpl->CloseConnection(closeCode, closeReason);
|
||||
impl->CloseConnection(closeCode, closeReason);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue