From 8fa8d9edfd5fe49b6512be5865e6e6a6079cb973 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Thu, 23 Apr 2015 13:48:47 +0200 Subject: [PATCH] Bug 1156352: Remove |UnixSocketRawData| from key store interfaces, r=chucklee --- ipc/keystore/KeyStore.cpp | 14 ++++++++------ ipc/keystore/KeyStore.h | 10 +++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ipc/keystore/KeyStore.cpp b/ipc/keystore/KeyStore.cpp index c6433789c23..e6dcc66a00c 100644 --- a/ipc/keystore/KeyStore.cpp +++ b/ipc/keystore/KeyStore.cpp @@ -813,7 +813,9 @@ void KeyStore::StreamSocket::ReceiveSocketData( nsAutoPtr& aMessage) { - mKeyStore->ReceiveSocketData(aMessage); + nsAutoPtr buffer(aMessage.forget()); + + mKeyStore->ReceiveSocketData(buffer); } ConnectionOrientedSocketIO* @@ -901,13 +903,13 @@ KeyStore::ResetHandlerInfo() } bool -KeyStore::CheckSize(UnixSocketRawData *aMessage, size_t aExpectSize) +KeyStore::CheckSize(UnixSocketBuffer *aMessage, size_t aExpectSize) { return (aMessage->GetSize() >= aExpectSize); } ResponseCode -KeyStore::ReadCommand(UnixSocketRawData *aMessage) +KeyStore::ReadCommand(UnixSocketBuffer *aMessage) { if (mHandlerInfo.state != STATE_IDLE) { NS_WARNING("Wrong state in ReadCommand()!"); @@ -946,7 +948,7 @@ KeyStore::ReadCommand(UnixSocketRawData *aMessage) } ResponseCode -KeyStore::ReadLength(UnixSocketRawData *aMessage) +KeyStore::ReadLength(UnixSocketBuffer *aMessage) { if (mHandlerInfo.state != STATE_READ_PARAM_LEN) { NS_WARNING("Wrong state in ReadLength()!"); @@ -971,7 +973,7 @@ KeyStore::ReadLength(UnixSocketRawData *aMessage) } ResponseCode -KeyStore::ReadData(UnixSocketRawData *aMessage) +KeyStore::ReadData(UnixSocketBuffer *aMessage) { if (mHandlerInfo.state != STATE_READ_PARAM_DATA) { NS_WARNING("Wrong state in ReadData()!"); @@ -1029,7 +1031,7 @@ KeyStore::SendData(const uint8_t *aData, int aLength) } void -KeyStore::ReceiveSocketData(nsAutoPtr& aMessage) +KeyStore::ReceiveSocketData(nsAutoPtr& aMessage) { MOZ_ASSERT(NS_IsMainThread()); diff --git a/ipc/keystore/KeyStore.h b/ipc/keystore/KeyStore.h index fb10706d6dc..c8f58a37c0a 100644 --- a/ipc/keystore/KeyStore.h +++ b/ipc/keystore/KeyStore.h @@ -160,7 +160,7 @@ private: ~KeyStore(); - void ReceiveSocketData(nsAutoPtr& aMessage); + void ReceiveSocketData(nsAutoPtr& aMessage); void OnConnectSuccess(enum SocketType aSocketType); void OnConnectError(enum SocketType aSocketType); @@ -176,10 +176,10 @@ private: void ResetHandlerInfo(); void Listen(); - bool CheckSize(UnixSocketRawData *aMessage, size_t aExpectSize); - ResponseCode ReadCommand(UnixSocketRawData *aMessage); - ResponseCode ReadLength(UnixSocketRawData *aMessage); - ResponseCode ReadData(UnixSocketRawData *aMessage); + bool CheckSize(UnixSocketBuffer *aMessage, size_t aExpectSize); + ResponseCode ReadCommand(UnixSocketBuffer *aMessage); + ResponseCode ReadLength(UnixSocketBuffer *aMessage); + ResponseCode ReadData(UnixSocketBuffer *aMessage); void SendResponse(ResponseCode response); void SendData(const uint8_t *data, int length);