зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1171017: Rename |BluetoothDaemonConnection| to |DaemonSocket|, r=shuang
This commit is contained in:
Родитель
21133b1b76
Коммит
41d8f3ac72
|
@ -1405,7 +1405,7 @@ const int BluetoothDaemonCoreModule::MAX_NUM_CLIENTS = 1;
|
|||
//
|
||||
// |BluetoothDaemonProtocol| also handles PDU receiving. It implements
|
||||
// the method |Handle| from |DaemonSocketIOConsumer|. The socket
|
||||
// connections of type |BluetoothDaemonConnection| invoke this method
|
||||
// connections of type |DaemonSocket| invoke this method
|
||||
// to forward received PDUs for processing by higher layers. The
|
||||
// implementation of |Handle| checks the service id of the PDU and
|
||||
// forwards it to the correct module class using the module's method
|
||||
|
@ -1439,7 +1439,7 @@ class BluetoothDaemonProtocol final
|
|||
public:
|
||||
BluetoothDaemonProtocol();
|
||||
|
||||
void SetConnection(BluetoothDaemonConnection* aConnection);
|
||||
void SetConnection(DaemonSocket* aConnection);
|
||||
|
||||
nsresult RegisterModule(uint8_t aId, uint8_t aMode, uint32_t aMaxNumClients,
|
||||
BluetoothSetupResultHandler* aRes) override;
|
||||
|
@ -1477,7 +1477,7 @@ private:
|
|||
void HandleGattSvc(const DaemonSocketPDUHeader& aHeader,
|
||||
DaemonSocketPDU& aPDU, void* aUserData);
|
||||
|
||||
BluetoothDaemonConnection* mConnection;
|
||||
DaemonSocket* mConnection;
|
||||
nsTArray<void*> mUserDataQ;
|
||||
};
|
||||
|
||||
|
@ -1485,7 +1485,7 @@ BluetoothDaemonProtocol::BluetoothDaemonProtocol()
|
|||
{ }
|
||||
|
||||
void
|
||||
BluetoothDaemonProtocol::SetConnection(BluetoothDaemonConnection* aConnection)
|
||||
BluetoothDaemonProtocol::SetConnection(DaemonSocket* aConnection)
|
||||
{
|
||||
mConnection = aConnection;
|
||||
}
|
||||
|
@ -1863,7 +1863,7 @@ BluetoothDaemonInterface::Init(
|
|||
// Init, step 1: Listen for command channel... */
|
||||
|
||||
if (!mCmdChannel) {
|
||||
mCmdChannel = new BluetoothDaemonConnection(mProtocol, this, CMD_CHANNEL);
|
||||
mCmdChannel = new DaemonSocket(mProtocol, this, CMD_CHANNEL);
|
||||
} else if (
|
||||
NS_WARN_IF(mCmdChannel->GetConnectionStatus() == SOCKET_CONNECTED)) {
|
||||
// Command channel should not be open; let's close it.
|
||||
|
@ -2355,7 +2355,7 @@ BluetoothDaemonInterface::OnConnectSuccess(int aIndex)
|
|||
case CMD_CHANNEL:
|
||||
// Init, step 3: Listen for notification channel...
|
||||
if (!mNtfChannel) {
|
||||
mNtfChannel = new BluetoothDaemonConnection(mProtocol, this, NTF_CHANNEL);
|
||||
mNtfChannel = new DaemonSocket(mProtocol, this, NTF_CHANNEL);
|
||||
} else if (
|
||||
NS_WARN_IF(mNtfChannel->GetConnectionStatus() == SOCKET_CONNECTED)) {
|
||||
/* Notification channel should not be open; let's close it. */
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
class BluetoothDaemonConnection;
|
||||
class DaemonSocket;
|
||||
class ListenSocket;
|
||||
|
||||
}
|
||||
|
@ -156,8 +156,8 @@ private:
|
|||
|
||||
nsCString mListenSocketName;
|
||||
nsRefPtr<mozilla::ipc::ListenSocket> mListenSocket;
|
||||
nsRefPtr<mozilla::ipc::BluetoothDaemonConnection> mCmdChannel;
|
||||
nsRefPtr<mozilla::ipc::BluetoothDaemonConnection> mNtfChannel;
|
||||
nsRefPtr<mozilla::ipc::DaemonSocket> mCmdChannel;
|
||||
nsRefPtr<mozilla::ipc::DaemonSocket> mNtfChannel;
|
||||
nsAutoPtr<BluetoothDaemonProtocol> mProtocol;
|
||||
|
||||
nsTArray<nsRefPtr<BluetoothResultHandler> > mResultHandlerQ;
|
||||
|
|
|
@ -218,7 +218,7 @@ public:
|
|||
MessageLoop* aIOLoop,
|
||||
int aFd, ConnectionStatus aConnectionStatus,
|
||||
UnixSocketConnector* aConnector,
|
||||
BluetoothDaemonConnection* aConnection,
|
||||
DaemonSocket* aConnection,
|
||||
DaemonSocketIOConsumer* aConsumer);
|
||||
|
||||
// Methods for |DataSocketIO|
|
||||
|
@ -240,7 +240,7 @@ public:
|
|||
void ShutdownOnIOThread() override;
|
||||
|
||||
private:
|
||||
BluetoothDaemonConnection* mConnection;
|
||||
DaemonSocket* mConnection;
|
||||
DaemonSocketIOConsumer* mConsumer;
|
||||
nsAutoPtr<DaemonSocketPDU> mPDU;
|
||||
bool mShuttingDownOnIOThread;
|
||||
|
@ -252,7 +252,7 @@ DaemonSocketIO::DaemonSocketIO(
|
|||
int aFd,
|
||||
ConnectionStatus aConnectionStatus,
|
||||
UnixSocketConnector* aConnector,
|
||||
BluetoothDaemonConnection* aConnection,
|
||||
DaemonSocket* aConnection,
|
||||
DaemonSocketIOConsumer* aConsumer)
|
||||
: ConnectionOrientedSocketIO(aConsumerLoop,
|
||||
aIOLoop,
|
||||
|
@ -339,10 +339,10 @@ DaemonSocketIO::ShutdownOnIOThread()
|
|||
}
|
||||
|
||||
//
|
||||
// BluetoothDaemonConnection
|
||||
// DaemonSocket
|
||||
//
|
||||
|
||||
BluetoothDaemonConnection::BluetoothDaemonConnection(
|
||||
DaemonSocket::DaemonSocket(
|
||||
DaemonSocketIOConsumer* aIOConsumer,
|
||||
DaemonSocketConsumer* aConsumer,
|
||||
int aIndex)
|
||||
|
@ -354,16 +354,16 @@ BluetoothDaemonConnection::BluetoothDaemonConnection(
|
|||
MOZ_ASSERT(mConsumer);
|
||||
}
|
||||
|
||||
BluetoothDaemonConnection::~BluetoothDaemonConnection()
|
||||
DaemonSocket::~DaemonSocket()
|
||||
{ }
|
||||
|
||||
// |ConnectionOrientedSocket|
|
||||
|
||||
nsresult
|
||||
BluetoothDaemonConnection::PrepareAccept(UnixSocketConnector* aConnector,
|
||||
MessageLoop* aConsumerLoop,
|
||||
MessageLoop* aIOLoop,
|
||||
ConnectionOrientedSocketIO*& aIO)
|
||||
DaemonSocket::PrepareAccept(UnixSocketConnector* aConnector,
|
||||
MessageLoop* aConsumerLoop,
|
||||
MessageLoop* aIOLoop,
|
||||
ConnectionOrientedSocketIO*& aIO)
|
||||
{
|
||||
MOZ_ASSERT(!mIO);
|
||||
|
||||
|
@ -380,7 +380,7 @@ BluetoothDaemonConnection::PrepareAccept(UnixSocketConnector* aConnector,
|
|||
// |DataSocket|
|
||||
|
||||
void
|
||||
BluetoothDaemonConnection::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
||||
DaemonSocket::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
||||
{
|
||||
MOZ_ASSERT(mIO);
|
||||
MOZ_ASSERT(mIO->IsConsumerThread());
|
||||
|
@ -393,7 +393,7 @@ BluetoothDaemonConnection::SendSocketData(UnixSocketIOBuffer* aBuffer)
|
|||
// |SocketBase|
|
||||
|
||||
void
|
||||
BluetoothDaemonConnection::Close()
|
||||
DaemonSocket::Close()
|
||||
{
|
||||
if (!mIO) {
|
||||
CHROMIUM_LOG("Bluetooth daemon already disconnected!");
|
||||
|
@ -410,19 +410,19 @@ BluetoothDaemonConnection::Close()
|
|||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonConnection::OnConnectSuccess()
|
||||
DaemonSocket::OnConnectSuccess()
|
||||
{
|
||||
mConsumer->OnConnectSuccess(mIndex);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonConnection::OnConnectError()
|
||||
DaemonSocket::OnConnectError()
|
||||
{
|
||||
mConsumer->OnConnectError(mIndex);
|
||||
}
|
||||
|
||||
void
|
||||
BluetoothDaemonConnection::OnDisconnect()
|
||||
DaemonSocket::OnDisconnect()
|
||||
{
|
||||
mConsumer->OnDisconnect(mIndex);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_ipc_bluetooth_BluetoothDaemonConnection_h
|
||||
#define mozilla_ipc_bluetooth_BluetoothDaemonConnection_h
|
||||
#ifndef mozilla_ipc_bluetooth_DaemonSocket_h
|
||||
#define mozilla_ipc_bluetooth_DaemonSocket_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/FileUtils.h"
|
||||
|
@ -110,17 +110,17 @@ protected:
|
|||
};
|
||||
|
||||
/*
|
||||
* |BluetoothDaemonConnection| represents the socket to connect to the
|
||||
* |DaemonSocket| represents the socket to connect to the
|
||||
* Bluetooth daemon. It offers connection establishment and sending
|
||||
* PDUs. PDU receiving is performed by |DaemonSocketIOConsumer|.
|
||||
*/
|
||||
class BluetoothDaemonConnection : public ConnectionOrientedSocket
|
||||
class DaemonSocket : public ConnectionOrientedSocket
|
||||
{
|
||||
public:
|
||||
BluetoothDaemonConnection(DaemonSocketIOConsumer* aIOConsumer,
|
||||
DaemonSocketConsumer* aConsumer,
|
||||
int aIndex);
|
||||
virtual ~BluetoothDaemonConnection();
|
||||
DaemonSocket(DaemonSocketIOConsumer* aIOConsumer,
|
||||
DaemonSocketConsumer* aConsumer,
|
||||
int aIndex);
|
||||
virtual ~DaemonSocket();
|
||||
|
||||
// Methods for |ConnectionOrientedSocket|
|
||||
//
|
||||
|
|
Загрузка…
Ссылка в новой задаче