From 7f554d1a7fb9da2192957a3565e8137d0e57bea5 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 23 Apr 2015 13:48:48 +0200 Subject: [PATCH] Bug 1156352: Remove |UnixSocketRawData| from NFC interfaces, r=allstars.chh --- dom/nfc/gonk/NfcService.cpp | 9 +++++---- dom/nfc/gonk/NfcService.h | 2 +- ipc/nfc/Nfc.cpp | 5 +++-- ipc/nfc/Nfc.h | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dom/nfc/gonk/NfcService.cpp b/dom/nfc/gonk/NfcService.cpp index 75709b505289..094303aa7e23 100644 --- a/dom/nfc/gonk/NfcService.cpp +++ b/dom/nfc/gonk/NfcService.cpp @@ -222,7 +222,7 @@ private: class NfcEventRunnable : public nsRunnable { public: - NfcEventRunnable(NfcMessageHandler* aHandler, UnixSocketRawData* aData) + NfcEventRunnable(NfcMessageHandler* aHandler, UnixSocketBuffer* aData) : mHandler(aHandler), mData(aData) { MOZ_ASSERT(NS_IsMainThread()); @@ -255,7 +255,7 @@ public: private: NfcMessageHandler* mHandler; - nsAutoPtr mData; + nsAutoPtr mData; }; NfcService::NfcService() @@ -383,10 +383,11 @@ NfcService::DispatchNfcEvent(const mozilla::dom::NfcEventOptions& aOptions) } void -NfcService::ReceiveSocketData(nsAutoPtr& aData) +NfcService::ReceiveSocketData(nsAutoPtr& aBuffer) { MOZ_ASSERT(mHandler); - nsCOMPtr runnable = new NfcEventRunnable(mHandler, aData.forget()); + nsCOMPtr runnable = + new NfcEventRunnable(mHandler, aBuffer.forget()); mThread->Dispatch(runnable, nsIEventTarget::DISPATCH_NORMAL); } diff --git a/dom/nfc/gonk/NfcService.h b/dom/nfc/gonk/NfcService.h index ef9404cf8aa0..353282aaa1e8 100644 --- a/dom/nfc/gonk/NfcService.h +++ b/dom/nfc/gonk/NfcService.h @@ -30,7 +30,7 @@ public: void DispatchNfcEvent(const mozilla::dom::NfcEventOptions& aOptions); virtual void ReceiveSocketData( - nsAutoPtr& aData) override; + nsAutoPtr& aBuffer) override; virtual void OnConnectSuccess(enum SocketType aSocketType) override; virtual void OnConnectError(enum SocketType aSocketType) override; diff --git a/ipc/nfc/Nfc.cpp b/ipc/nfc/Nfc.cpp index 566f4adf9b99..60afc79ad0be 100644 --- a/ipc/nfc/Nfc.cpp +++ b/ipc/nfc/Nfc.cpp @@ -188,12 +188,13 @@ NfcConsumer::PostToNfcDaemon(const uint8_t* aData, size_t aSize) } void -NfcConsumer::ReceiveSocketData(nsAutoPtr& aData) +NfcConsumer::ReceiveSocketData(nsAutoPtr& aBuffer) { MOZ_ASSERT(NS_IsMainThread()); if (mListener) { - mListener->ReceiveSocketData(aData); + nsAutoPtr buffer(aBuffer.forget()); + mListener->ReceiveSocketData(buffer); } } diff --git a/ipc/nfc/Nfc.h b/ipc/nfc/Nfc.h index 784677ddd394..e9b23d8ab1e3 100644 --- a/ipc/nfc/Nfc.h +++ b/ipc/nfc/Nfc.h @@ -24,7 +24,7 @@ public: STREAM_SOCKET }; - virtual void ReceiveSocketData(nsAutoPtr& aData) = 0; + virtual void ReceiveSocketData(nsAutoPtr& aData) = 0; virtual void OnConnectSuccess(enum SocketType aSocketType) = 0; virtual void OnConnectError(enum SocketType aSocketType) = 0; @@ -73,7 +73,7 @@ public: private: void ReceiveSocketData( - nsAutoPtr& aData) override; + nsAutoPtr& aBuffer) override; void OnConnectSuccess() override; void OnConnectError() override;