зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1158081 - Patch (1/2): Define macro to declare SocketObserver functions, r=tzimmermann
This commit is contained in:
Родитель
a40b086236
Коммит
246bf336ec
|
@ -40,9 +40,16 @@ public:
|
|||
* changes from CONNECTED/LISTENING to DISCONNECTED.
|
||||
*/
|
||||
virtual void OnSocketDisconnect(BluetoothSocket* aSocket) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define BT_DECL_SOCKET_OBSERVER \
|
||||
public: \
|
||||
virtual void ReceiveSocketData(BluetoothSocket* aSocket, \
|
||||
nsAutoPtr<mozilla::ipc::UnixSocketBuffer>& aMessage) override; \
|
||||
virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override; \
|
||||
virtual void OnSocketConnectError(BluetoothSocket* aSocket) override; \
|
||||
virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override;
|
||||
|
||||
END_BLUETOOTH_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,7 @@ class BluetoothOppManager : public BluetoothSocketObserver
|
|||
|
||||
public:
|
||||
BT_DECL_PROFILE_MGR_BASE
|
||||
BT_DECL_SOCKET_OBSERVER
|
||||
virtual void GetName(nsACString& aName)
|
||||
{
|
||||
aName.AssignLiteral("OPP");
|
||||
|
@ -68,14 +69,6 @@ public:
|
|||
bool ExtractBlobHeaders();
|
||||
void CheckPutFinal(uint32_t aNumRead);
|
||||
|
||||
// The following functions are inherited from BluetoothSocketObserver
|
||||
void ReceiveSocketData(
|
||||
BluetoothSocket* aSocket,
|
||||
nsAutoPtr<mozilla::ipc::UnixSocketBuffer>& aMessage) override;
|
||||
virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override;
|
||||
virtual void OnSocketConnectError(BluetoothSocket* aSocket) override;
|
||||
virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override;
|
||||
|
||||
protected:
|
||||
virtual ~BluetoothOppManager();
|
||||
|
||||
|
|
|
@ -80,22 +80,15 @@ class BluetoothHfpManager : public BluetoothSocketObserver
|
|||
{
|
||||
public:
|
||||
BT_DECL_HFP_MGR_BASE
|
||||
BT_DECL_SOCKET_OBSERVER
|
||||
virtual void GetName(nsACString& aName)
|
||||
{
|
||||
aName.AssignLiteral("HFP/HSP");
|
||||
}
|
||||
|
||||
static BluetoothHfpManager* Get();
|
||||
|
||||
// The following functions are inherited from BluetoothSocketObserver
|
||||
virtual void ReceiveSocketData(
|
||||
BluetoothSocket* aSocket,
|
||||
nsAutoPtr<mozilla::ipc::UnixSocketBuffer>& aMessage) override;
|
||||
virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override;
|
||||
virtual void OnSocketConnectError(BluetoothSocket* aSocket) override;
|
||||
virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override;
|
||||
|
||||
bool Listen();
|
||||
|
||||
/**
|
||||
* This function set up a Synchronous Connection (SCO) link for HFP.
|
||||
* Service Level Connection (SLC) should be established before SCO setup
|
||||
|
|
|
@ -36,6 +36,7 @@ class BluetoothOppManager : public BluetoothSocketObserver
|
|||
{
|
||||
public:
|
||||
BT_DECL_PROFILE_MGR_BASE
|
||||
BT_DECL_SOCKET_OBSERVER
|
||||
virtual void GetName(nsACString& aName)
|
||||
{
|
||||
aName.AssignLiteral("OPP");
|
||||
|
@ -64,14 +65,6 @@ public:
|
|||
bool ExtractBlobHeaders();
|
||||
void CheckPutFinal(uint32_t aNumRead);
|
||||
|
||||
// The following functions are inherited from BluetoothSocketObserver
|
||||
void ReceiveSocketData(
|
||||
BluetoothSocket* aSocket,
|
||||
nsAutoPtr<mozilla::ipc::UnixSocketBuffer>& aMessage) override;
|
||||
virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override;
|
||||
virtual void OnSocketConnectError(BluetoothSocket* aSocket) override;
|
||||
virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override;
|
||||
|
||||
protected:
|
||||
virtual ~BluetoothOppManager();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче