diff --git a/dom/bluetooth/bluedroid/BluetoothSocket.cpp b/dom/bluetooth/bluedroid/BluetoothSocket.cpp index 745d3e652a9..d85ccf51847 100644 --- a/dom/bluetooth/bluedroid/BluetoothSocket.cpp +++ b/dom/bluetooth/bluedroid/BluetoothSocket.cpp @@ -254,38 +254,6 @@ public: ShutdownSocketTask(DroidSocketImpl* aImpl) : mImpl(aImpl) { } }; -class SocketReceiveTask : public SocketIORunnable -{ -public: - SocketReceiveTask(DroidSocketImpl* aImpl, UnixSocketRawData* aData) - : SocketIORunnable(aImpl) - , mRawData(aData) - { - MOZ_ASSERT(aData); - } - - NS_IMETHOD Run() - { - MOZ_ASSERT(NS_IsMainThread()); - - DroidSocketImpl* impl = GetIO(); - - if (impl->IsShutdownOnMainThread()) { - NS_WARNING("mConsumer is null, aborting receive!"); - // Since we've already explicitly closed and the close happened before - // this, this isn't really an error. Since we've warned, return OK. - return NS_OK; - } - - MOZ_ASSERT(impl->mConsumer); - impl->mConsumer->ReceiveSocketData(mRawData); - return NS_OK; - } - -private: - nsAutoPtr mRawData; -}; - class SocketSendTask : public Task { public: @@ -503,9 +471,9 @@ DroidSocketImpl::OnSocketCanReceiveWithoutBlocking(int aFd) } incoming->mSize = ret; - nsRefPtr t = - new SocketReceiveTask(this, incoming.forget()); - NS_DispatchToMainThread(t); + nsRefPtr r = + new SocketIOReceiveRunnable(this, incoming.forget()); + NS_DispatchToMainThread(r); // If ret is less than MAX_READ_SIZE, there's no // more data in the socket for us to read now.