From 20050ee452e8245384e27ff04679bbb8c34844a1 Mon Sep 17 00:00:00 2001 From: Vicamo Yang Date: Fri, 1 Feb 2013 20:28:15 +0800 Subject: [PATCH] Bug 826931 - Part 1/3: UnixSocket - allow ownership take-over in ReceiveSocketData(). r=qDot,echou --- dom/bluetooth/BluetoothHfpManager.cpp | 2 +- dom/bluetooth/BluetoothHfpManager.h | 2 +- dom/bluetooth/BluetoothOppManager.cpp | 2 +- dom/bluetooth/BluetoothOppManager.h | 2 +- dom/bluetooth/BluetoothScoManager.cpp | 2 +- dom/bluetooth/BluetoothScoManager.h | 2 +- ipc/unixsocket/UnixSocket.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dom/bluetooth/BluetoothHfpManager.cpp b/dom/bluetooth/BluetoothHfpManager.cpp index 1b4d1804a9f..411f6c2c224 100644 --- a/dom/bluetooth/BluetoothHfpManager.cpp +++ b/dom/bluetooth/BluetoothHfpManager.cpp @@ -667,7 +667,7 @@ BluetoothHfpManager::HandleShutdown() // Virtual function of class SocketConsumer void -BluetoothHfpManager::ReceiveSocketData(UnixSocketRawData* aMessage) +BluetoothHfpManager::ReceiveSocketData(nsAutoPtr& aMessage) { MOZ_ASSERT(NS_IsMainThread()); diff --git a/dom/bluetooth/BluetoothHfpManager.h b/dom/bluetooth/BluetoothHfpManager.h index 10e3f42d268..c84831f00e6 100644 --- a/dom/bluetooth/BluetoothHfpManager.h +++ b/dom/bluetooth/BluetoothHfpManager.h @@ -52,7 +52,7 @@ class BluetoothHfpManager : public mozilla::ipc::UnixSocketConsumer { public: static BluetoothHfpManager* Get(); - virtual void ReceiveSocketData(mozilla::ipc::UnixSocketRawData* aMessage) + virtual void ReceiveSocketData(nsAutoPtr& aMessage) MOZ_OVERRIDE; bool Connect(const nsAString& aDeviceObjectPath, diff --git a/dom/bluetooth/BluetoothOppManager.cpp b/dom/bluetooth/BluetoothOppManager.cpp index e54296cf741..b7f2dd6a391 100644 --- a/dom/bluetooth/BluetoothOppManager.cpp +++ b/dom/bluetooth/BluetoothOppManager.cpp @@ -894,7 +894,7 @@ BluetoothOppManager::ClientDataHandler(UnixSocketRawData* aMessage) // Virtual function of class SocketConsumer void -BluetoothOppManager::ReceiveSocketData(UnixSocketRawData* aMessage) +BluetoothOppManager::ReceiveSocketData(nsAutoPtr& aMessage) { if (mLastCommand) { ClientDataHandler(aMessage); diff --git a/dom/bluetooth/BluetoothOppManager.h b/dom/bluetooth/BluetoothOppManager.h index b22c39287e5..25dc71a9583 100644 --- a/dom/bluetooth/BluetoothOppManager.h +++ b/dom/bluetooth/BluetoothOppManager.h @@ -33,7 +33,7 @@ public: ~BluetoothOppManager(); static BluetoothOppManager* Get(); - void ReceiveSocketData(mozilla::ipc::UnixSocketRawData* aMessage) + void ReceiveSocketData(nsAutoPtr& aMessage) MOZ_OVERRIDE; void ClientDataHandler(mozilla::ipc::UnixSocketRawData* aMessage); void ServerDataHandler(mozilla::ipc::UnixSocketRawData* aMessage); diff --git a/dom/bluetooth/BluetoothScoManager.cpp b/dom/bluetooth/BluetoothScoManager.cpp index 388d2a819bd..1291f3ea512 100644 --- a/dom/bluetooth/BluetoothScoManager.cpp +++ b/dom/bluetooth/BluetoothScoManager.cpp @@ -171,7 +171,7 @@ BluetoothScoManager::Get() // Virtual function of class SocketConsumer void -BluetoothScoManager::ReceiveSocketData(mozilla::ipc::UnixSocketRawData* aMessage) +BluetoothScoManager::ReceiveSocketData(nsAutoPtr& aMessage) { // SCO socket do nothing here MOZ_NOT_REACHED("This should never be called!"); diff --git a/dom/bluetooth/BluetoothScoManager.h b/dom/bluetooth/BluetoothScoManager.h index f4849b98cb4..aa78808b692 100644 --- a/dom/bluetooth/BluetoothScoManager.h +++ b/dom/bluetooth/BluetoothScoManager.h @@ -22,7 +22,7 @@ public: ~BluetoothScoManager(); static BluetoothScoManager* Get(); - void ReceiveSocketData(mozilla::ipc::UnixSocketRawData* aMessage) + void ReceiveSocketData(nsAutoPtr& aMessage) MOZ_OVERRIDE; bool Connect(const nsAString& aDeviceObjectPath); diff --git a/ipc/unixsocket/UnixSocket.h b/ipc/unixsocket/UnixSocket.h index cdbdab533aa..19a53aa2030 100644 --- a/ipc/unixsocket/UnixSocket.h +++ b/ipc/unixsocket/UnixSocket.h @@ -130,7 +130,7 @@ public: * * @param aMessage Data received from the socket. */ - virtual void ReceiveSocketData(UnixSocketRawData* aMessage) = 0; + virtual void ReceiveSocketData(nsAutoPtr& aMessage) = 0; /** * Queue data to be sent to the socket on the IO thread. Can only be called on