mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 1e93024c9fec (bug 1164425) for bustage
This commit is contained in:
parent
e62550b3f7
commit
c89b0c098f
@ -1911,7 +1911,7 @@ BluetoothDaemonInterface::OnConnectSuccess(enum Channel aChannel)
|
||||
} else if (
|
||||
NS_WARN_IF(mNtfChannel->GetConnectionStatus() == SOCKET_CONNECTED)) {
|
||||
/* Notification channel should not be open; let's close it. */
|
||||
mNtfChannel->Close();
|
||||
mNtfChannel->CloseSocket();
|
||||
}
|
||||
if (!mListenSocket->Listen(mNtfChannel)) {
|
||||
OnConnectError(NTF_CHANNEL);
|
||||
@ -1942,7 +1942,7 @@ BluetoothDaemonInterface::OnConnectError(enum Channel aChannel)
|
||||
switch (aChannel) {
|
||||
case NTF_CHANNEL:
|
||||
// Close command channel
|
||||
mCmdChannel->Close();
|
||||
mCmdChannel->CloseSocket();
|
||||
case CMD_CHANNEL:
|
||||
// Stop daemon and close listen socket
|
||||
unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
|
||||
@ -2120,7 +2120,7 @@ BluetoothDaemonInterface::Init(
|
||||
} else if (
|
||||
NS_WARN_IF(mCmdChannel->GetConnectionStatus() == SOCKET_CONNECTED)) {
|
||||
// Command channel should not be open; let's close it.
|
||||
mCmdChannel->Close();
|
||||
mCmdChannel->CloseSocket();
|
||||
}
|
||||
|
||||
// The listen socket's name is generated with a random postfix. This
|
||||
@ -2182,7 +2182,7 @@ private:
|
||||
mInterface->mProtocol->UnregisterModuleCmd(0x01, this);
|
||||
} else {
|
||||
// Cleanup, step 3: Close command channel
|
||||
mInterface->mCmdChannel->Close();
|
||||
mInterface->mCmdChannel->CloseSocket();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ public:
|
||||
void Run() override
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mSocket->Close();
|
||||
mSocket->CloseSocket();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -282,7 +282,7 @@ BluetoothOppManager::ConnectInternal(const nsAString& aDeviceAddress)
|
||||
|
||||
// Stop listening because currently we only support one connection at a time.
|
||||
if (mServerSocket) {
|
||||
mServerSocket->Close();
|
||||
mServerSocket->CloseSocket();
|
||||
mServerSocket = nullptr;
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ BluetoothOppManager::Listen()
|
||||
* BT restarts.
|
||||
*/
|
||||
if (mServerSocket) {
|
||||
mServerSocket->Close();
|
||||
mServerSocket->CloseSocket();
|
||||
mServerSocket = nullptr;
|
||||
}
|
||||
|
||||
@ -1552,7 +1552,7 @@ void
|
||||
BluetoothOppManager::Disconnect(BluetoothProfileController* aController)
|
||||
{
|
||||
if (mSocket) {
|
||||
mSocket->Close();
|
||||
mSocket->CloseSocket();
|
||||
} else {
|
||||
BT_WARNING("%s: No ongoing file transfer to stop", __FUNCTION__);
|
||||
}
|
||||
|
@ -743,7 +743,7 @@ BluetoothSocket::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
||||
// |SocketBase|
|
||||
|
||||
void
|
||||
BluetoothSocket::Close()
|
||||
BluetoothSocket::CloseSocket()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(sBluetoothSocketInterface);
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
// Methods for |SocketBase|
|
||||
//
|
||||
|
||||
void Close() override;
|
||||
void CloseSocket() override;
|
||||
|
||||
void OnConnectSuccess() override;
|
||||
void OnConnectError() override;
|
||||
|
@ -720,7 +720,7 @@ BluetoothSocket::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
||||
// |SocketBase|
|
||||
|
||||
void
|
||||
BluetoothSocket::Close()
|
||||
BluetoothSocket::CloseSocket()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (!mIO) {
|
||||
|
@ -38,7 +38,7 @@ public:
|
||||
int aChannel);
|
||||
inline void Disconnect()
|
||||
{
|
||||
Close();
|
||||
CloseSocket();
|
||||
}
|
||||
|
||||
inline void GetAddress(nsAString& aDeviceAddress)
|
||||
@ -102,7 +102,7 @@ public:
|
||||
// Methods for |SocketBase|
|
||||
//
|
||||
|
||||
void Close() override;
|
||||
void CloseSocket() override;
|
||||
|
||||
void OnConnectSuccess() override;
|
||||
void OnConnectError() override;
|
||||
|
@ -569,7 +569,7 @@ BluetoothDaemonConnection::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
||||
// |SocketBase|
|
||||
|
||||
void
|
||||
BluetoothDaemonConnection::Close()
|
||||
BluetoothDaemonConnection::CloseSocket()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
|
@ -131,7 +131,7 @@ public:
|
||||
// Methods for |SocketBase|
|
||||
//
|
||||
|
||||
void Close() override;
|
||||
void CloseSocket() override;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -314,6 +314,27 @@ ListenSocket::~ListenSocket()
|
||||
MOZ_ASSERT(!mIO);
|
||||
}
|
||||
|
||||
void
|
||||
ListenSocket::Close()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mIO) {
|
||||
return;
|
||||
}
|
||||
|
||||
// From this point on, we consider mIO as being deleted. We sever
|
||||
// the relationship here so any future calls to listen or connect
|
||||
// will create a new implementation.
|
||||
mIO->ShutdownOnMainThread();
|
||||
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketIOShutdownTask(mIO));
|
||||
|
||||
mIO = nullptr;
|
||||
|
||||
NotifyDisconnect();
|
||||
}
|
||||
|
||||
bool
|
||||
ListenSocket::Listen(UnixSocketConnector* aConnector,
|
||||
ConnectionOrientedSocket* aCOSocket)
|
||||
@ -364,24 +385,9 @@ ListenSocket::GetSocketAddr(nsAString& aAddrStr)
|
||||
// |SocketBase|
|
||||
|
||||
void
|
||||
ListenSocket::Close()
|
||||
ListenSocket::CloseSocket()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mIO) {
|
||||
return;
|
||||
}
|
||||
|
||||
// From this point on, we consider mIO as being deleted. We sever
|
||||
// the relationship here so any future calls to listen or connect
|
||||
// will create a new implementation.
|
||||
mIO->ShutdownOnMainThread();
|
||||
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketIOShutdownTask(mIO));
|
||||
|
||||
mIO = nullptr;
|
||||
|
||||
NotifyDisconnect();
|
||||
Close();
|
||||
}
|
||||
|
||||
} // namespace ipc
|
||||
|
@ -50,6 +50,12 @@ public:
|
||||
*/
|
||||
bool Listen(ConnectionOrientedSocket* aCOSocket);
|
||||
|
||||
/**
|
||||
* Queues the internal representation of socket for deletion. Can be called
|
||||
* from main thread.
|
||||
*/
|
||||
void Close();
|
||||
|
||||
/**
|
||||
* Get the current sockaddr for the socket
|
||||
*/
|
||||
@ -58,7 +64,7 @@ public:
|
||||
// Methods for |SocketBase|
|
||||
//
|
||||
|
||||
void Close() override;
|
||||
void CloseSocket() override;
|
||||
|
||||
private:
|
||||
ListenSocketIO* mIO;
|
||||
|
@ -340,7 +340,7 @@ SocketIORequestClosingRunnable::Run()
|
||||
SocketBase* socketBase = io->GetSocketBase();
|
||||
MOZ_ASSERT(socketBase);
|
||||
|
||||
socketBase->Close();
|
||||
socketBase->CloseSocket();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public:
|
||||
* Queues the internal representation of socket for deletion. Can be called
|
||||
* from main thread.
|
||||
*/
|
||||
virtual void Close() = 0;
|
||||
virtual void CloseSocket() = 0;
|
||||
|
||||
/**
|
||||
* Callback for socket connect/accept success. Called after connect/accept has
|
||||
|
@ -542,6 +542,29 @@ StreamSocket::SendSocketData(const nsACString& aStr)
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
StreamSocket::Close()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mIO) {
|
||||
return;
|
||||
}
|
||||
|
||||
mIO->CancelDelayedConnectTask();
|
||||
|
||||
// From this point on, we consider mIO as being deleted.
|
||||
// We sever the relationship here so any future calls to listen or connect
|
||||
// will create a new implementation.
|
||||
mIO->ShutdownOnMainThread();
|
||||
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketIOShutdownTask(mIO));
|
||||
|
||||
mIO = nullptr;
|
||||
|
||||
NotifyDisconnect();
|
||||
}
|
||||
|
||||
void
|
||||
StreamSocket::GetSocketAddr(nsAString& aAddrStr)
|
||||
{
|
||||
@ -617,28 +640,10 @@ StreamSocket::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
||||
// |SocketBase|
|
||||
|
||||
void
|
||||
StreamSocket::Close()
|
||||
StreamSocket::CloseSocket()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!mIO) {
|
||||
return;
|
||||
}
|
||||
|
||||
mIO->CancelDelayedConnectTask();
|
||||
|
||||
// From this point on, we consider mIO as being deleted.
|
||||
// We sever the relationship here so any future calls to listen or connect
|
||||
// will create a new implementation.
|
||||
mIO->ShutdownOnMainThread();
|
||||
|
||||
XRE_GetIOMessageLoop()->PostTask(FROM_HERE, new SocketIOShutdownTask(mIO));
|
||||
|
||||
mIO = nullptr;
|
||||
|
||||
NotifyDisconnect();
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
||||
|
@ -55,6 +55,12 @@ public:
|
||||
const char* aAddress,
|
||||
int aDelayMs = 0);
|
||||
|
||||
/**
|
||||
* Queues the internal representation of socket for deletion. Can be called
|
||||
* from main thread.
|
||||
*/
|
||||
void Close();
|
||||
|
||||
/**
|
||||
* Get the current sockaddr for the socket
|
||||
*/
|
||||
@ -68,7 +74,7 @@ public:
|
||||
// Methods for |SocketBase|
|
||||
//
|
||||
|
||||
void Close() override;
|
||||
void CloseSocket() override;
|
||||
|
||||
protected:
|
||||
virtual ~StreamSocket();
|
||||
|
Loading…
Reference in New Issue
Block a user