diff --git a/dom/bluetooth/BluetoothSocketObserver.h b/dom/bluetooth/BluetoothSocketObserver.h index 6135440b9682..8b68ccc7aa4f 100644 --- a/dom/bluetooth/BluetoothSocketObserver.h +++ b/dom/bluetooth/BluetoothSocketObserver.h @@ -19,7 +19,7 @@ class BluetoothSocketObserver public: virtual void ReceiveSocketData( BluetoothSocket* aSocket, - nsAutoPtr& aMessage) = 0; + nsAutoPtr& aBuffer) = 0; /** * A callback function which would be called when a socket connection diff --git a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp index 7fdeefb9d0db..bf8f85dd931c 100644 --- a/dom/bluetooth/bluedroid/BluetoothOppManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothOppManager.cpp @@ -876,7 +876,7 @@ BluetoothOppManager::ValidateFileName() } bool -BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketRawData* aMessage) +BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketBuffer* aMessage) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aMessage); @@ -926,7 +926,7 @@ BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketRawData* aMessage) } void -BluetoothOppManager::ServerDataHandler(UnixSocketRawData* aMessage) +BluetoothOppManager::ServerDataHandler(UnixSocketBuffer* aMessage) { MOZ_ASSERT(NS_IsMainThread()); @@ -1053,7 +1053,7 @@ BluetoothOppManager::ServerDataHandler(UnixSocketRawData* aMessage) } void -BluetoothOppManager::ClientDataHandler(UnixSocketRawData* aMessage) +BluetoothOppManager::ClientDataHandler(UnixSocketBuffer* aMessage) { MOZ_ASSERT(NS_IsMainThread()); @@ -1165,12 +1165,12 @@ BluetoothOppManager::ClientDataHandler(UnixSocketRawData* aMessage) // Virtual function of class SocketConsumer void BluetoothOppManager::ReceiveSocketData(BluetoothSocket* aSocket, - nsAutoPtr& aMessage) + nsAutoPtr& aBuffer) { if (mIsServer) { - ServerDataHandler(aMessage); + ServerDataHandler(aBuffer); } else { - ClientDataHandler(aMessage); + ClientDataHandler(aBuffer); } } diff --git a/dom/bluetooth/bluedroid/BluetoothOppManager.h b/dom/bluetooth/bluedroid/BluetoothOppManager.h index 4128a2c15dc9..e49ef3c37eb5 100644 --- a/dom/bluetooth/bluedroid/BluetoothOppManager.h +++ b/dom/bluetooth/bluedroid/BluetoothOppManager.h @@ -48,8 +48,8 @@ public: static const int MAX_PACKET_LENGTH = 0xFFFE; static BluetoothOppManager* Get(); - void ClientDataHandler(mozilla::ipc::UnixSocketRawData* aMessage); - void ServerDataHandler(mozilla::ipc::UnixSocketRawData* aMessage); + void ClientDataHandler(mozilla::ipc::UnixSocketBuffer* aMessage); + void ServerDataHandler(mozilla::ipc::UnixSocketBuffer* aMessage); bool Listen(); @@ -71,7 +71,7 @@ public: // The following functions are inherited from BluetoothSocketObserver void ReceiveSocketData( BluetoothSocket* aSocket, - nsAutoPtr& aMessage) override; + nsAutoPtr& aMessage) override; virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override; virtual void OnSocketConnectError(BluetoothSocket* aSocket) override; virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override; @@ -128,7 +128,7 @@ private: * length. */ bool ComposePacket(uint8_t aOpCode, - mozilla::ipc::UnixSocketRawData* aMessage); + mozilla::ipc::UnixSocketBuffer* aMessage); /** * OBEX session status. diff --git a/dom/bluetooth/bluedroid/BluetoothSocket.cpp b/dom/bluetooth/bluedroid/BluetoothSocket.cpp index 2a3caeb78e19..c374c7fcd3e6 100644 --- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp +++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp @@ -676,7 +676,10 @@ BluetoothSocket::ReceiveSocketData(nsAutoPtr& aMessage) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mObserver); - mObserver->ReceiveSocketData(this, aMessage); + + nsAutoPtr buffer(aMessage.forget()); + + mObserver->ReceiveSocketData(this, buffer); } void diff --git a/dom/bluetooth/bluez/BluetoothHfpManager.cpp b/dom/bluetooth/bluez/BluetoothHfpManager.cpp index 4be775521efb..8f2242610450 100644 --- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp +++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp @@ -750,7 +750,7 @@ BluetoothHfpManager::ParseAtCommand(const nsACString& aAtCommand, // Virtual function of class SocketConsumer void BluetoothHfpManager::ReceiveSocketData(BluetoothSocket* aSocket, - nsAutoPtr& aMessage) + nsAutoPtr& aMessage) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aSocket); diff --git a/dom/bluetooth/bluez/BluetoothHfpManager.h b/dom/bluetooth/bluez/BluetoothHfpManager.h index e107ed9ff451..9fb5fd548d22 100644 --- a/dom/bluetooth/bluez/BluetoothHfpManager.h +++ b/dom/bluetooth/bluez/BluetoothHfpManager.h @@ -90,7 +90,7 @@ public: // The following functions are inherited from BluetoothSocketObserver virtual void ReceiveSocketData( BluetoothSocket* aSocket, - nsAutoPtr& aMessage) override; + nsAutoPtr& aMessage) override; virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override; virtual void OnSocketConnectError(BluetoothSocket* aSocket) override; virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override; diff --git a/dom/bluetooth/bluez/BluetoothOppManager.cpp b/dom/bluetooth/bluez/BluetoothOppManager.cpp index 1d68c57527ef..df2e8536a43c 100644 --- a/dom/bluetooth/bluez/BluetoothOppManager.cpp +++ b/dom/bluetooth/bluez/BluetoothOppManager.cpp @@ -832,7 +832,7 @@ BluetoothOppManager::ValidateFileName() } bool -BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketRawData* aMessage) +BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketBuffer* aMessage) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aMessage); @@ -881,7 +881,7 @@ BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketRawData* aMessage) } void -BluetoothOppManager::ServerDataHandler(UnixSocketRawData* aMessage) +BluetoothOppManager::ServerDataHandler(UnixSocketBuffer* aMessage) { MOZ_ASSERT(NS_IsMainThread()); @@ -1008,7 +1008,7 @@ BluetoothOppManager::ServerDataHandler(UnixSocketRawData* aMessage) } void -BluetoothOppManager::ClientDataHandler(UnixSocketRawData* aMessage) +BluetoothOppManager::ClientDataHandler(UnixSocketBuffer* aMessage) { MOZ_ASSERT(NS_IsMainThread()); @@ -1120,7 +1120,7 @@ BluetoothOppManager::ClientDataHandler(UnixSocketRawData* aMessage) // Virtual function of class SocketConsumer void BluetoothOppManager::ReceiveSocketData(BluetoothSocket* aSocket, - nsAutoPtr& aMessage) + nsAutoPtr& aMessage) { if (mIsServer) { ServerDataHandler(aMessage); diff --git a/dom/bluetooth/bluez/BluetoothOppManager.h b/dom/bluetooth/bluez/BluetoothOppManager.h index 01250002cae6..e713f71d7848 100644 --- a/dom/bluetooth/bluez/BluetoothOppManager.h +++ b/dom/bluetooth/bluez/BluetoothOppManager.h @@ -44,8 +44,8 @@ public: static const int MAX_PACKET_LENGTH = 0xFFFE; static BluetoothOppManager* Get(); - void ClientDataHandler(mozilla::ipc::UnixSocketRawData* aMessage); - void ServerDataHandler(mozilla::ipc::UnixSocketRawData* aMessage); + void ClientDataHandler(mozilla::ipc::UnixSocketBuffer* aMessage); + void ServerDataHandler(mozilla::ipc::UnixSocketBuffer* aMessage); bool Listen(); @@ -67,7 +67,7 @@ public: // The following functions are inherited from BluetoothSocketObserver void ReceiveSocketData( BluetoothSocket* aSocket, - nsAutoPtr& aMessage) override; + nsAutoPtr& aMessage) override; virtual void OnSocketConnectSuccess(BluetoothSocket* aSocket) override; virtual void OnSocketConnectError(BluetoothSocket* aSocket) override; virtual void OnSocketDisconnect(BluetoothSocket* aSocket) override; @@ -118,7 +118,7 @@ private: * length. */ bool ComposePacket(uint8_t aOpCode, - mozilla::ipc::UnixSocketRawData* aMessage); + mozilla::ipc::UnixSocketBuffer* aMessage); /** * OBEX session status. diff --git a/dom/bluetooth/bluez/BluetoothSocket.cpp b/dom/bluetooth/bluez/BluetoothSocket.cpp index f92f7434b782..5bb7e94cef95 100644 --- a/dom/bluetooth/bluez/BluetoothSocket.cpp +++ b/dom/bluetooth/bluez/BluetoothSocket.cpp @@ -611,7 +611,10 @@ BluetoothSocket::ReceiveSocketData(nsAutoPtr& aMessage) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(mObserver); - mObserver->ReceiveSocketData(this, aMessage); + + nsAutoPtr buffer(aMessage.forget()); + + mObserver->ReceiveSocketData(this, buffer); } void