Bug 1156352: Remove |UnixSocketRawData| from key store interfaces, r=chucklee

This commit is contained in:
Thomas Zimmermann 2015-04-23 13:48:47 +02:00
parent befbf30c0b
commit 72a6a6dca7
2 changed files with 13 additions and 11 deletions

View File

@ -813,7 +813,9 @@ void
KeyStore::StreamSocket::ReceiveSocketData(
nsAutoPtr<UnixSocketRawData>& aMessage)
{
mKeyStore->ReceiveSocketData(aMessage);
nsAutoPtr<UnixSocketBuffer> 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<UnixSocketRawData>& aMessage)
KeyStore::ReceiveSocketData(nsAutoPtr<UnixSocketBuffer>& aMessage)
{
MOZ_ASSERT(NS_IsMainThread());

View File

@ -160,7 +160,7 @@ private:
~KeyStore();
void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage);
void ReceiveSocketData(nsAutoPtr<UnixSocketBuffer>& 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);